The head writer and executive producer of Doctor Who, Steven Moffat, is to step down from the show, the BBC has confirmed.
His last series will go out in spring 2017 following a Christmas special, after which he will be replaced by Broadchurch writer Chris Chibnall.
Moffat took over the reins on series five of the world's longest running sci-fi series in 2010.
BBC One's controller, Charlotte Moore, said Moffat was an "absolute genius".
In a statement, the BBC said he had been responsible for introducing the 11th and 12th Doctors - Matt Smith and Peter Capaldi - as well as two companions in Karen Gillan and Jenna Coleman.
Moffat said it took "a lot of gin and tonic" to talk Chibnall into taking up his new position.
"I am beyond delighted that one of the true stars of British television drama will be taking the Time Lord even further into the future," he said.
"At the start of season 11, Chris Chibnall will become the new showrunner of Doctor Who. And I will be thrown in a skip."
Chibnall described Doctor Who as "the ultimate BBC programme - bold, unique, vastly entertaining, and adored all around the world".
He added: "So it's a privilege and a joy to be the next curator of this funny, scary and emotional family drama.
"I've loved Doctor Who since I was four years old, and I'm relishing the thought of working with the exceptional team at BBC Wales to create new characters, creatures and worlds for the Doctor to explore."
Ms Moore thanked Moffat "for everything he has given Doctor Who".
She said: "I've loved working with him, he is an absolute genius and has brought fans all over the world such joy.
"I will be very sad to see him leave the show but I can't wait to see what he will deliver in his last-ever series next year with a brand new companion."