James Marsden revealed Julia Roberts helped him land his role in the 2007 flick “Hairspray” during an appearance on Thursday’s “Ellen DeGeneres Show”.

Marsden says he went to a restaurant just off Broadway in New York to have an interview with the director Adam Shankman when Roberts approached him.

RELATED: Ben Schwartz Cons James Marsden Into Showing Off His Jim Carrey Impression

The star, who plays Corny Collins in the much-loved film, tells DeGeneres, “I had a tap on my shoulder and it was Julia Roberts just standing there and she said, ‘Sorry, I didn’t mean to interrupt, but I just wanted to tell you you’re in my favourite movie, ‘The Notebook’, and I loved what you do in the film and congratulations on it. Bye, nice to meet you.’

“And Adam Shankman turns to me and says, ‘If you didn’t have the role already, I think that sort of sealed it.’

“I have Julia Roberts to thank for that, she cemented me getting cast in that role.”

RELATED: Jim Carrey And James Marsden Serenade Kelly Clarkson

Marsden also talks about bingeing “Schitt’s Creek” during quarantine, and how he worked on the second season of “Dead to Me” even though he was only supposed to be in the first season.

Plus, Marsden and tWitch play a game called “Twinning” that has them showing off their dance moves, and the actor raises $10,000 for World Central Kitchen. See more in the clip below.