At York Castle, the outlaw Dick Turpin is identified by his former schoolteacher. Turpin had been using the name Richard Palmer.

Richard Turpin (bapt. 21 September 1705 7 April 1739) was an English highwayman whose exploits were romanticised following his execution in York for horse theft. Turpin may have followed his father's trade as a butcher early in his life but, by the early 1730s, he had joined a gang of deer thieves and, later, became a poacher, burglar, horse thief and killer. He is also known for a fictional 200-mile (320 km) overnight ride from London to York on his horse Black Bess, a story that was made famous by the Victorian novelist William Harrison Ainsworth almost 100 years after Turpin's death.

Turpin's involvement in the crime with which he is most closely associatedhighway robberyfollowed the arrest of the other members of his gang in 1735. He then disappeared from public view towards the end of that year, only to resurface in 1737 with two new accomplices, one of whom Turpin may have accidentally shot and killed. Turpin fled from the scene and shortly afterwards killed a man who attempted his capture.

Later that year, he moved to Yorkshire and assumed the alias of John Palmer. While he was staying at an inn, local magistrates became suspicious of "Palmer" and made enquiries as to how he funded his lifestyle. Suspected of being a horse thief, "Palmer" was imprisoned in York Castle, to be tried at the next assizes. Turpin's true identity was revealed by a letter he wrote to his brother-in-law from his prison cell, which fell into the hands of the authorities. On 22 March 1739, Turpin was found guilty on two charges of horse theft and sentenced to death; he was hanged at Knavesmire on 7 April 1739.

Turpin became the subject of legend after his execution, romanticised as dashing and heroic in English ballads and popular theatre of the 18th and 19th centuries and in film and television of the 20th century.

York Castle is a fortified complex in the city of York, England. It consists of a sequence of castles, prisons, law courts and other buildings, which were built over the last nine centuries on the south side of the River Foss. The now-ruined keep of the medieval Norman castle is commonly referred to as Clifford's Tower. Built originally on the orders of William I to dominate the former Viking city of Jórvík, the castle suffered a tumultuous early history before developing into a major fortification with extensive water defences. After a major explosion in 1684 rendered the remaining military defences uninhabitable, York Castle continued to be used as a jail and prison until 1929.

The first motte and bailey castle on the site was built in 1068 following the Norman conquest of York. After the destruction of the castle by rebels and a Viking army in 1069, York Castle was rebuilt and reinforced with extensive water defences, including a moat and an artificial lake. York Castle formed an important royal fortification in the north of England.

In 1190, 150 local Jews were killed in a pogrom in the timber castle keep; most of them died by suicide in order not to fall into the hands of the mob. Henry III rebuilt the castle in stone in the middle of the 13th century, creating a keep with a unique quatrefoil design, supported by an outer bailey wall and a substantial gatehouse. During the Scottish wars between 1298 and 1338, York Castle was frequently used as the centre of royal administration across England, as well as an important military base of operations.

York Castle fell into disrepair by the 15th and 16th centuries, becoming used increasingly as a jail for both local felons and political prisoners. By the time of Elizabeth I the castle was estimated to have lost all of its military value but was maintained as a centre of royal authority in York. The outbreak of the English Civil War in 1642 saw York Castle being repaired and refortified, playing a part in the Royalist defence of York in 1644 against Parliamentary forces. York Castle continued to be garrisoned until 1684, when an explosion destroyed the interior of Clifford's Tower. The castle bailey was redeveloped in a neoclassical style in the 18th century as a centre for county administration in Yorkshire, and was used as a jail and debtors' prison. Prison reform in the 19th century led to the creation of a new prison built in a Tudor Gothic style on the castle site in 1825; used first as a county and then as a military prison, this facility was demolished in 1935. By the 20th century the ruin of Clifford's Tower had become a well-known tourist destination and national monument; today the site is owned by English Heritage and open to the public. The other remaining buildings serve as the York Castle Museum and the Crown Court.