The lead role in Doctor Who was once offered to a black actor who turned it down, one of the BBC1 show's writers has said.

Fantasy writer Neil Gaiman - who has scripted editions of the programme - said he still hoped a non-white star would take the role one day.

He made the revelation on his blog shortly after Peter Capaldi was announced as the next regeneration of the Time Lord, but said it felt like a "missed opportunity".

"Would I like a person of colour as the Doctor? Absolutely," he said, and went on: "I have no doubt there will be. I know one black actor who was already offered the part of the Doctor, and who turned it down."

Gaiman pointed out the black actor to whom he referred did not turn down the part in the latest round of casting, but it dated back to an earlier point.

He wrote: "No, he didn't turn down the role of the 12th Doctor. There have been many Doctors cast over the years."

The programme's executive producer Steven Moffat has already suggested he only ever had Capaldi in mind to replace the 11th Doctor Matt Smith.

"Yes. The list went 'Peter Capaldi' - it was a very short list," Moffat said when the new Doctor was announced at the weekend.

Gaiman said the part should go to the most suitable actor regardless of skin colour.

"Paterson Joseph was the Marquis de Carabas in Neverwhere, because he aced the auditions, and beat all the other actors, mostly white, who tried out for the role. I'd want that kind of performance at the audition for the Doctor. And there are certainly actors good enough out there that it feels like a missed opportunity."

He added: "I was rather disappointed that Paterson Joseph didn't get it last time, although I've loved Matt's 11."

Paterson Joseph, well known for his roles in Peep Show, Green Wing and Casualty, is currently appearing as DI Wes Leyton in Law and Order UK.

Neil Gaiman will appear at Stripped, a celebration of graphic novels and comics, at the Edinburgh Fringe Festival at the end of this month.