Harry Styles in "Dunkirk." Warner Bros. The latest movie by Christopher Nolan features stars like Tom Hardy, Oscar-winner Mark Rylance, and Cillian Murphy — but when you leave the theater after watching "Dunkirk" (opens July 21), one of the performances you'll likely remember most will be the acting debut of pop star Harry Styles.

Formerly part of One Direction, Styles has branched off into being one of the biggest solo performers in the world, and now he's showing he has acting chops as well.

"Dunkirk" is an intimately told look at the Allied evacuation of the beaches of Dunkirk, France during World War II. Told in three parts — soldiers on the beach, British pilots fighting off German bombers in the sky, and civilian boats on the water en route to Dunkirk to help with the evacuation — Nolan explores the journey of a handful of men involved in all three instances.

Styles plays Alex, one of the soldiers trying to get off the beach, and it's not easy. Escaping out of sinking destroyers and avoiding being shot at by oncoming Germans soldiers on foot advancing towards the beach, Styles delivers a riveting performance. And for a movie limited with dialogue, he gets a large part of the lines that are spoken.

Harry Styles is in trouble in "Dunkirk." Warner Bros. Nolan is no stranger to doing unique casting. He cast Robin Williams in one of the actor's rare turns as a bad guy in 2002's "Insomnia," had David Bowie play Nikola Tesla in 2006's "The Prestige," and then there was the shocking choice of choosing Heath Ledger to play The Joker in 2008's "The Dark Knight," which went on to earn Ledger a posthumous Oscar win for best supporting actor.

Nolan sees similarities to those castings and going with Styles.

"Ever since I cast Heath Ledger as The Joker and raised all kinds of eyebrows, I've recognized that this is my responsibility and I really have to spot the potential in somebody who hasn't done a particular thing before," Nolan told Business Insider. "Because whether you're taking about Harry Styles or Mark Rylance you don't really want to cast them in a position where they are doing something they've already done. You want to give the audience something different. So you're looking at their talent and how that can be used."

And there was little preference given to Styles in the casting process (though Nolan has admitted he wasn't aware how famous Styles really is).

Warner Bros. "The truth is, Harry auditioned for our casting director, he sent the tape along. The casting director rightly pointed out how good it was. We threw him into the mix with many, many other young men and he earned his seat at the table over a series of very hard-fought auditions," Nolan said.

Styles definitely holds his own on screen, proving he can move us with his dramatic acting as much as his comedy, which he showed off earlier this year on "Saturday Night Live."

Nolan can't wait for audiences to see this side of Styles.

"I'm very excited for people to see what he has done in the film," Nolan said. "I think it's truthful and it's a very tough role he's playing, too."