Josh Hartnett at the "Oppenheimer" UK Premiere at Odeon Luxe Leicester Square on July 13, 2023 in London, England.
CNN  — 

It took over a decade for Josh Hartnett and director Christopher Nolan to finally have the opportunity to work together in “Oppenheimer,” but there was a time when Hartnett was almost cast as Nolan’s Batman.

According to the director, Hartnett was an early contender to play the Caped Crusader in Nolan’s “Batman” trilogy that kicked off in 2005 with “Batman Begins,” but the actor didn’t end up screen-testing for the role.

“It never got that far,” Nolan said on Thursday’s episode of the “Happy Sad Confused” podcast.

Nolan said that he did meet with Hartnett at the time to discuss the role, and recalled him being “a young actor whose work I was very interested in, and I had an initial conversation with him.”

But the “Pearl Harbor” actor was interested in another role, in a film that just happened to be something that Nolan’s brother Jonathan was working on as a co-screenwriter.

“He had read my brother’s script for ‘The Prestige’ at the time and was more interested in getting involved with that,” Nolan said of the 2006 magician thriller.

(From left) Kenneth Branagh, Rami Malek, Matt Damon, Emily Blunt, Florence Pugh, Cillian Murphy, Christopher Nolan, Robert Downey Jr. and Josh Hartnett at the UK premiere of "Oppenheimer" in July.

Of course, Christian Bale ended up landing the role of Bruce Wayne/Batman in 2005’s “Batman Begins,” going on to reprise the iconic character in 2008’s “The Dark Knight” and “The Dark Knight Rises” in 2012. Incidentally, Bale also was cast in one of the lead roles in “The Prestige,” which Nolan also directed.

Cillian Murphy, a longtime collaborator of Nolan’s who also stars in “Oppenheimer,” was similarly considered for the role of Bruce Wayne in “Batman Begins,” Nolan said in a May interview with Entertainment Weekly. Ultimately, Murphy played the villain, Dr. Jonathan Crane, more commonly known as the Scarecrow, in “Begins.”

All roads lead back to Nolan, though, who cast Murphy as physicist and “father of the atomic bomb” J. Robert Oppenheimer, and Hartnett as physicist Ernest Lawrence in his World War II-era epic “Oppenheimer.” They star alongside Matt Damon, Emily Blunt, and Robert Downey Jr., among others.

“Oppenheimer” premieres in theaters on Friday.