Comedy legend Steve Carell has revealed how he came up with the idea for the 2005 classic 'The Forty Year Old Virgin'.

Speaking to Jimmy Fallon this week, the 59-year-old recounted his days in the comedy troupe 'The Second City', which has consisted of many famous names in comedy and acting including Bill Murray, John Bellushi, Tina Fey and Amy Poehler.

One particular rejected skit idea that Carell came up with had a very familiar storyline.

"There was one character I was working on and it was a poker scene. The guy and all of his friends are talking about sex and they're trying to regale each other with all these stories of sexual conquest," said Carrell.

"My guy didn't have any sort of context, no frame of reference, and obviously was trying to lie. And that became '40 Year Old Virgin.'

"After we did 'Anchorman', [Judd Apatow] came to me and said, 'hey, would you like to get together, do you have any ideas to pitch?'" the 'U.S. Office' actor continued. "So we got together and I pitched all these other ideas. Just before I left, I said, 'you know what, there's one more - there was this thing I was kind of trying to get going at The Second City that never really went anywhere.'

"He heard that and said, 'I could sell that like immediately'. The next week he talked to an executive, sold it, we wrote it, it got greenlit."

The film went on to be a huge success and remains one of the most influential comedies of the 2000's. It was Carell's first big leading role, which he transitioned into from his strong performance as fan-favourite Brick Tamland in 'Anchorman'. He also won 'Best Comedic Performance' at the MTV Movie Awards.

Watch the full interview below.

Steve Carell stars in 'Minions: The Rise of Gru' in cinemas July 1.