In 1882, the T'keyn visited Earth for their regular millenial judgement of the planet. Sondrah declared Earth guilty of war, slavery and genocide and thus must be destroyed. The Eleventh Doctor was in Deadwood at the time and was the first person Sondrah was going to execute.
However, the Doctor stated the Shadow Proclamation allowed a defence. Sondrah and the Doctor then entered the Nexus, with projections of past incarnations of the Doctor being created to help during the trial. (COMIC: Dead Man's Hand)