The filmmaker has cast the former One Direction star in the supporting role of Alex in his World War II epic, reported Entertainment Tonight.
"When I cast Heath Ledger as the Joker, it raised a lot of eyebrows and caused a lot of comment.
"I have to trust my instincts, and Harry was perfect for this part," Nolan said.
"Dunkirk" arrives in cinemas on July 21.