Benedict Cumberbatch will make his superhero debut in next year in Marvel’s Doctor Strange. But it almost wasn’t to be for the ‘Sherlock’ actor, as his commitments to stage play Hamlet nearly cost him the role.

Benedict Cumberbatch filming Doctor StrangeBenedict Cumberbatch filming Doctor Strange

Speaking to Empire magazine, the film’s director Scott Derrickson said that Cumberbatch was “the only actor we seriously considered” for the superhero role. But unfortunately, Cumberbatch had already signed on to play Hamlet at London’s Barbican in the autumn of 2015.

More: Sherlock Convention Fans Refused Refund After Benedict Cumberbatch Cancels Appearance

Marvel were initially aiming for a summer 2016 release date for Doctor Strange, which meant that Cumberbatch wouldn't have been able to fulfil the shooting schedule. “It just wasn’t possible,” Derrickson said. “To his credit he said, ‘I can’t bail out of Hamlet. I’ve given my word.’”

The director said he then met with “a lot of good actors”, including Joaquin Phoenix, Jared Leto and Ryan Gosling, but eventually he returned to Marvel Studios head Kevin Feige and told him “it’s got to be Benedict.”

Cumberbatch himself genuinely thought he’d missed out on the role. “I really did think I had to kiss it goodbye,” he told the magazine. But Marvel were so keen to get Cumberbatch that the summer 2016 release date then became autumn 2016.

More: Benedict Cumberbatch Wanted To Be In Absolutely Fabulous

“If you can’t jump on board when the ride’s going past. that’s usually it,” Cumberbatch said. “So the hugest compliment they paid me was to come back to me. It motivated me to try to fulfil their faith in me.”

Watch the trailer for Doctor Strange below: