Doctor Who’ executive producer Steven Moffat has revealed that the role of the Doctor has previously been offered to a black actor, but that “for various reasons, it didn’t work out”.

In an interview for the BBC programme’s official magazine this week, Moffat said that the flagship show had “no excuse” not to offer more diversity in its casting, and that the recent announcement of stage actress Pearl Mackie – whose father is from the West Indies – as the Doctor’s companion was made after they had failed in their original intention.

Steven MoffatSteven Moffat, the lead writer and showrunner of 'Doctor Who'

“We decided that the new companion was going to be non-white, and that was an absolute decision, because we need to do better on that. We just have to,” Moffat said. “I don't mean that we've done terribly - our guest casts are among the most diverse on television - but I feel as though I could have done better overall.”

Moffat didn’t reveal the name of the actor they had approached to play the Doctor. Presumably, this was done before the appointment of Peter Capaldi in 2013, when there were calls to cast a non-white actor for the part.

More: ‘Doctor Who’ – stage actress Pearl Mackie revealed as the Doctor’s new companion

“Two non-white leads would be amazing. In fact, a lot of people would barely notice,” he continued. “I certainly don't think there's ever been a problem with making the Doctor black, which is why it should happen one day.”

“Sometimes the nature of a particular show - historical dramas, for instance - makes diversity more of a challenge, but ‘Doctor Who’ has absolutely nowhere to hide on this,” he reflected. “Young people watching have to know that they have a place in the future. That really matters. You have to care profoundly what children's shows in particular say about where you're going to be.”

Moffat has previously announced that he’ll be stepping down as ‘Doctor Who’s showrunner and lead writer at the end of the next series, due to be aired in spring 2017, with ‘Broadchurch’s Chris Chibnall stepping in.

More: ‘Doctor Who’ spin-off ‘Class’ adds Katherine Kelly to cast