Leonardo Dicaprio nearly missed out on a role in 'Titanic'.

The Hollywood heartthrob played Jack Dawson in the iconic 1997 film but director James Cameron revealed that it almost fell apart due to the star's poor attitude during auditions.

In a career retrospective for GQ, James said: "There was a meeting with Leo and then there was a screen test with Leo.

"The meeting was funny because I am sitting in my conference room, waiting to meet an actor. And I look around, and all the women in the entire office are in the meeting. They all wanted to meet Leo. It was hysterical."

The 'Avatar' director said that the first meeting with DiCaprio went well as the actor "charmed everybody" but things did not go as smoothly when he was asked back for a screen test with co-star Kate Winslet.

James, 68, said: "So he came back a couple of days later, and I had the camera set up to record the video.

"He didn't know he was going to test. He thought it was another meeting to meet Kate. So I said, 'Okay, we'll just go in the next room, and we'll run some lines and I'll video it.'

"And he said, 'You mean, I'm reading?' I said, 'Yeah'. He said, 'Oh, I don't read.'"

The filmmaker continued: "I shook his hand and said, 'Thanks for coming by.' And he said, 'Wait, wait, wait. If I don't read, I don't get the part? Just like that?'

"And I said, 'Oh yeah. Come on. This is a giant movie that is going to take two years of my life, and you'll be gone doing five other things while I'm doing post-production. So, I'm not going to f*** it up by making the wrong decision in casting. So, you're going to read, or you're not going to get the part.'"