Capaldi, famed for his role as The Thick Of It's foul-mouthed Malcolm Tucker, will become the latest regeneration of the Doctor in the Christmas Day edition of the show.
Executive producer Moffat said: "We asked and he was incredibly excited to come and audition. We didn't tell him that he was the only person auditioning because that would be oddly pressuring."
Discussing the casting, he said: "He's one of the best actors in the country and is very beloved. I was at the Baftas, shortly before we were contemplating Peter, and heard the cheer he got from the audience.
"Nobody has a bad thing to say about him and that's not a minor issue when it comes to casting a Doctor. They've got to be lovely. And he's a huge fan of Doctor Who."
Matt Smith, who finishes his stint as The Doctor in the Christmas special, praised the choice and said they had already caught up over a meal.
He said: "I had lunch with Peter Capaldi the other day and I think he is going to be incredible. He has the most brilliant ideas and as a fan I am genuinely excited to see what he is going to do because I think he's going to do something extraordinary."
Co-star Jenna Coleman, who plays assistant Clara Oswald has revealed she had known the identity of the new Doctor a month before it was publicly announced.
In an interview to plug the Christmas special The Time Of The Doctor, she said she and Smith were informed during a royal visit to the Cardiff studios on July 3, although the casting was not confirmed until a live TV broadcast on August 4.
Coleman said she managed to hold on to the secret: "I think I've learnt my lesson in that the best thing to do is not to tell anybody and then you don't have your own paranoia that you've let something out."
She said of the revelation: "It was kind of that moment 'of course, makes sense'. It's funny as I don't think he was one of the names that was originally being speculated about and it wasn't until the week before that his name came up.
"He's going to be so different to Matt and take the show in an interesting direction."
Coleman added: "It will be a different show next year."