The D-Train” takes bromance to a very physical level.

When it came time to shoot the film’s central sex scene between stars Jack Black and James Marsden, the team behind the bawdy comedy decided to wait until the last day of filming. That gave the scene an added level of importance.

“It seemed like we were saving it for celebration time,” said Marsden during a question and answer period Friday at the film’s Sundance Film Festival premiere.

Like “Hump Day” or “I Love You Man,” the film traipses along the edge between man crush and sexual attraction.

“In comedy you feel like you’ve seen it all and this was so subversive,” said Marsden.

The picture was warmly received by the crowd at the Library Theater. Because of its star power, it’s been viewed as one of the festival’s more commercial titles and there were a number of prominent executives and potential bidders in the audience, including Netflix Chief Content Officer Ted Sarandos.

“The D-Train” centers on a scheme by a high school reject (Black) to lure the most popular kid in his class (Marsden) back to their reunion. His seduction efforts get a little out of hand.

Black said he didn’t draw from his own life when it came to understanding the character.

“My high school reunion was less eventful,” he joked. “The script made me laugh so hard. It was very real.”

The sex scene between Black and Marsden casts a shadow over the second half of the film, but its screen time is fleeting.

“We always thought that less was more,” said director Jarrad Paul.

His co-director Andrew Mogel agreed in an innuendo-laden fashion.

“Ultimately we decided it was best as a quick pop,” he said.