Jack Nicholson pulled a gun on Leonardo DiCaprio on the set of 'The Departed'.

The Hollywood legend - who stars alongside DiCaprio in the 2006 crime drama about the Irish mafia - decided to improvise on part of The Script and pulled out a real gun when he voices his suspicion there is a traitor in his criminal gang.

The film's director Martin Scorsese claims the gun-pulling, which was cut from the final edit of the movie, gives him "chills" when he thinks about it because of how real it seemed.

Speaking in his new book 'Conversations with Scorsese', he said: "The first thing Jack did was sniff the glass and say, 'I smell a rat.' And then he pulled a gun on him. He didn't tell me he had a gun. It was great.

"We took a lot out, but Leo's reaction is real-time. I still get chills when he says, 'I smell a rat.' It's so real to me."

'The Departed' - which also starred Matt Damon and Mark Wahlberg - grossed $290 million worldwide upon its release in October 2006.