Peter Capaldi will be the new star of Doctor Who.
He was unveiled live on television on Sunday evening amid tight security in a bid to prevent his identity leaking out.
The Scottish actor, famous for his role as foul-mouthed Malcolm Tucker in political comedy The Thick Of It, is a lifelong fan of the show and wrote a letter to the Radio Times about the Daleks when he was a teenager.
He is the first Oscar winner to take on the role.
Capaldi said: "Being asked to play The Doctor is an amazing privilege.
"Like the Doctor himself I find myself in a state of utter terror and delight. I can't wait to get started."
His appointment was revealed on a special live show presented by Zoe Ball, which included interviews with predecessor Matt Smith, who leaves at Christmas.
Speaking on the show, the 55-year-old said: "It's so wonderful not to keep this secret any longer. But it has been absolutely fantastic in its own way, so many wonderful things have been happening. It was quite hard because even though I'm a lifelong Doctor Who fan, I haven't played Doctor Who since I was nine in the playground.
"I downloaded the old scripts from the internet and read those. I think Malcolm has been banished from the mirror by this Doctor Who, who certainly would not put up with any of Malcolm's language or attitude. I think Doctor Who is an extraordinary show."
Capaldi won an Academy Award in 1994 for the best short film (Live Action) for Franz Kafka's It's A Wonderful Life, but really became a household name thanks to his performance as foul-mouthed spin-doctor Tucker.
He has also written several shows including a documentary about 500 years history of Scottish portrait painting and Cricklewood Greats - a spoof about the heyday of the British film industry.
Capaldi has appeared in Doctor Who before - playing Caecilius in the episode The Fires of Pompeii in 2008.
He will film his first scenes for Doctor Who this Autumn, but will appear in forthcoming films The Fifth Estate and Disney's Maleficent.
He is also currently filming new BBC One drama series The Musketeers, in which he plays Cardinal Richelieu which will launch in early 2014.
The decision was welcomed by Smith tonight, who pre-recorded a message to Capaldi, saying: "I just want to wish my successor all the best and just say good luck and good on you for getting it, because I know he is both a huge fan of the show and a really nice guy.
"The casting of it made me really excited genuinely, and as a fan I think it's a really canny choice, so good luck mate, it's going to be a thrill."
Smith added: "if I had to pick someone, I'd pick him, because I think he's great. and wierdly enough, after the eleventh hour, he came up to me in the street and said, 'ah mate, well done. I watched your episode last night, it was brilliant, I think you're really good. and I really needed that, I needed a sort of boost and I never forgot it.
"I'm excited because I know what's coming and he's going to have a blast."
Of his own time on the famous programme, he said: "I've loved it, I really have and now I'll miss it. But when you've gotta go, you've gotta go.
"There was a backlash when I was cast, I was 26 and I was unknown, and people went, 'that is not Doctor Who'.
"Of course there's always a part of you that goes I never want to go. There are no parts like this.
"I think it's a good time for me to move on, I've got the 50th anniversary and it's the biggest year in the show's history and I'm playing the part and I pass it on with a smile to the next guy and I say good luck buddy, you're gonna have to work hard."
Steven Moffat, lead writer and executive producer of the programme, said: "It's an incendiary combination: one of the most talented actors of his generation is about to play the best part on television. Peter Capaldi is in the TARDIS!"
The decision was also welcomed by Doctor Who companion Jenna Coleman, who said: "I'm so excited Peter Capaldi is the man taking on the challenge of becoming the Twelfth Doctor.
"With Steven's writing and his talent I know we'll be making an amazing show with an incredible incarnation of number 12. I can't wait to start this new adventure!"
Writing on Twitter Armando Ianucci said: "There can't be a funnier, wiser, more exciting Time Lord than Peter Capaldi. The universe is in great hands."
Sources close to the show claimed only 10 people knew the name of the new Doctor, and they were using the codename Houdini to try and keep it a secret.
But bookmakers William Hill said just a few weeks ago, on July 26, odds for Capaldi to get the part were at 40/1 but had dropped to 5/6 by Friday when betting was suspended.
Spokesman Joe Crilly said tonight's announcement came off the back of a " sizeable week long".
"Everyone has tried their best to keep it quiet although it looks as though someone may have let the secret slip within the last week or so," he said.
"The gamble was not solely on Capaldi however and there were many other contenders for the crown."
Earlier today a flurry of excitement was sparked when a BBC blog site appeared to reveal the identity of the new doctor ahead of the announcement as Welsh actor Aneurin Barnard, who currently plays plays King Richard III in BBC One series The White Queen.
The URL, or page address, for the site remained blank while its URL included the words "aneurin-barnard-is-the-twelfth-doctor", prompting a frenzy on Twitter.
But the URL later changed to suggest that "Barry Chuckle" was the new doctor.
BBC One Controller Charlotte Moore said: "Peter Capaldi has all the genius and versatility needed to take on the mantel of the great Time Lord and make the role his own.
"He'll bring his own particular wisdom, charisma and wit to the 12th Doctor and take the show into an exciting new era."
Ben Stephenson, controller of BBC Drama Commissioning, added: "We started thinking Peter Capaldi might be the right person to take on this iconic part a few months ago.
"But it was only when he did a secret audition at Steven's house under the cover of darkness that we knew we had our man. He's an extraordinarily talented actor who can seemingly turn his hand to anything.
"We can't wait to premiere his unique take on the Doctor on Christmas Day and we are sure he's going to become one of the all-time classic Doctors."