We learn from Battlefield that in a parallel universe where magic is central and technology less prevalent a future incarnation of the Doctor, calling himself Merlin, works with the Britons in their centuries long battle with the immortal Morgaine, who at one point, probably when the Doctor arrived, ruled all 13 worlds of their solar system.
He regenerates at least once (Ancelyn knows of this ability) and helps Arthur win many battles (including Camlann). Finally, around the year 1200 at Badon, the Doctor defeats Morgaine's armies completely. Arthur is killed in the battle, and the Doctor, pretending that he's putting him in suspended animation, sends his body across the dimensions to the 'Avalon' lake in our universe (The propaganda value of the idea that the King might awaken when cured, and use Excalibur to call for aid, would help in restoring order).
Remembering the adventures of his seventh self, he keys the door to the tomb to his voice pattern, and leaves himself a note. Remembering also that Morgaine and her last detachment of followers fell into the trap of pursuing Excalibur's signal that Arthur was about to awaken, he preset such a signal. Having buried his King, the Doctor was set upon by Morgaine, who sealed him into ice caves (She could always beat him at chess, a metaphor for their many conflicts).
When Excalibur's signal activated, Ancelyn, a high ranking officer in the now peaceful other-dimensional world, was sent alone to welcome his King home, unsuspecting that Morgaine (now battle queen of the S'Rax, probably an alien race, perhaps the Sycorax? cf The Stones of Blood) was still active.