The Capital Punishment Amendment Act 1868 (31 & 32 Vict. c.24) received Royal Assent on 29 May 1868, putting an end to public executions for murder in the United Kingdom. The Act required that all prisoners sentenced to death for murder be executed within the walls of the prison in which they were being held, and that their bodies be buried in the prison grounds. It was prompted at least in part by the efforts of reformers such as Sir Robert Peel and Charles Dickens, who called in the national press for an end to the “grotesque spectacle” of public executions. Abolition of public executions was one of the recommendations of the Royal Commission on Capital Punishment 1864–1866. A similar measure, the Capital Punishment within Prisons Bill, had been introduced in 1867, but failed for lack of parliamentary time.
The first execution under the new law was carried out by William CalcraftWilliam Calcraft (11 October 1800 – 13 December 1879) was a 19th-century English hangman, one of the most prolific of British executioners. on 13 August 1868 at Maidstone Gaol; 18-year-old Thomas Wells was hanged for the murder of Edward Walshe, the stationmaster at Dover Priory railway station. Calcraft had previously carried out the last public execution in the UK, when he hanged the Fenian Michael Barrett in front of Newgate Prison on 26 May 1868 for his part in the 1867 Clerkenwell Outrage.