The Doctor Who Christmas special will see the Time Lord’s companion Bill Potts return, and will also feature a cameo performance from Sherlock co-creator Mark Gatiss.

The festive special, which will be the last time Peter Capaldi will be seen on-screen playing the Doctor, will be called Twice Upon A Time, it has been revealed during a cast panel at San Diego’s Comic-Con.

Details of Bill’s return have not been revealed, but Gatiss will play a World War One soldier known as The Captain.

During the 2017 series finale, fans were left wondering about Bill (played by Pearl Mackie) and they also saw the Doctor’s regeneration process begin after he was fatally shot by a Mondasian Cyberman.

Viewers saw his flashback through previous incarnations as past sidekicks played by Billie Piper, Jenna Coleman, Catherine Tate and John Barrowman were seen calling out his name.

Bill Potts, played by Pearl Mackie, will return (BBC)

But the biggest clue to the plot of this year’s Christmas special came in the closing moments of the episode when Capaldi’s character struggled out of the Tardis into a snowy wasteland and came face to face with the original Doctor.

Capaldi’s 12th Doctor shouted: “I don’t want to change again, never again, I can’t keep on being somebody else.

“I’m staying. I will not change. I am the Doctor.”

Doctor Who
Peter Capaldi as the Doctor and David Bradley as the First Doctor (BBC)

But he was answered by a figure who emerged through the snow saying: “No, no, no, I am the Doctor, the original.”

Played by David Bradley, the character was dressed as the late William Hartnell’s Doctor, the first ever incarnation of the Time Lord.

It harked back to a 1966 episode, The Tenth Planet, in which the Doctor travelled to the South Pole to take on the Cybermen.

Doctor Who
Peter Capaldi as the Doctor and Pearl Mackie as Bill Potts (BBC)

Bill’s return will have fans speculating after she was rescued by her love interest from her debut episode, who disappeared as a ghost in a watery puddle, but then returned to invite a grieving Bill to travel through the universe by her side.

Capaldi will be replaced by Broadchurch star Jodie Whittaker, who will become the first woman to ever play the role.

The episode is also the Doctor Who swansong for the show’s writer and executive producer Steven Moffat.

Broadchurch creator Chris Chibnall will take over from Moffat and said he had always known he wanted the 13th Doctor to be a woman.

Doctor Who revealed
Jodie Whittaker will become the first woman to play the Time Lord in Doctor Who (BBC)

Following the announcement of Whittaker as the new lead, he said in a statement: “After months of lists, conversations, auditions, recalls, and a lot of secret-keeping, we’re excited to welcome Jodie Whittaker as the 13th Doctor.

“I always knew I wanted the 13th Doctor to be a woman, and we’re thrilled to have secured our number one choice. Her audition for The Doctor simply blew us all away.

“Jodie is an in-demand, funny, inspiring, super-smart force of nature and will bring loads of wit, strength and warmth to the role. The 13th Doctor is on her way.”

To-date the trailer on the corporation’s official Facebook page of Whittaker being unveiled as the new Doctor has been viewed more than 10 million times.