Harry Styles may not have an acting background but acclaimed director Christopher Nolan says the One Direction star nailed his Dunkirk audition.

The 23-year-old boyband star underwent quite the transformation for his role as a young soldier in the retelling of the 1940 Miracle of Dunkirk, and even cut off his long curly hair for the part.

In an interview with the LA Times, Nolan revealed Styles was picked on merit during auditions that attracted thousands of hopeful actors.

"When we put the cast together, we had some established names, Kenneth Branagh, Mark Rylance, Tom Hardy, Cillian Murphy," he said.

"But for the guys on the beach, we really wanted young unknowns. He's (Harry) not that unknown, but he'd never done anything as an actor before."

"So he auditioned. I auditioned literally thousands of young men with different combinations of young men. And he had it."

In an early trailer for the film, which opens later in the summer, Styles was shown submerged under water in a lifejacket and sitting helplessly on the French beach.

Irish actor Cillian Murphy previously gave Styles the seal of approval for his debut movie role telling Radio Times magazine: "Harry Styles is great. I had very few scenes with Harry but we got to hang out and I've got to say he's a great, great kid, and really, really funny."

"Above all, Chris knows talent and would have cast Harry for a reason.

"There's a long history of musicians moving over into acting and I come from that world myself," Murphy, who originally wanted to pursue a career in music, said. "So I'm sure he'll be terrific in the role. I trust Chris implicitly in that."

Dunkirk tells the story of Operation Dynamo - the 1940 mission that evacuated over 300,000 Allied troops when they became trapped by the Nazis. 

Earlier this week Styles revealed his debut solo single, Sign Of The Times, would be released on April 7.