'Ham' means village, so Middleham is the middle village.
The site has been settled since Roman times: after the 9th Legion conquered York in 69AD, they built the Great North Road, and a branch of it went via Middleham to Bainbridge. There was a Roman guard station near Middleham, to control traffic on the river Ure.
After the Norman Conquest, it was given to Alan Rufus, William the Conqueror's nephew. He built a wooden motte and bailey castle, and its earthworks can still be seen on William's Hill, immediately south of Middleham. The present castle was begun in 1190. Middleham was referred to as 'Medelai' in the Domesday Book.
In 1389, the Lord of Middleham manor got royal permission for a weekly market and an annual fair.
By 1462, the castle belonged to Richard Neville, Earl of Warwick (known as the Kingmaker), and in that year, Richard - the future king Richard III - came here to learn the skills of knighthood. He met Neville's daughter, Anne, here, and married her in 1472. (Richard III died at the Battle of Bosworth Field - the last English king to die in battle. His remains have recently been discovered).
The castle was dismantled in 1646, but significant ruins remain.
Middleham has been known for horse race training since Isaac Cape set up here in 1765. Racing is the number one employer, and there is a Middleham Trainers' Association. Trainers in Middleham include Mark Johnston and Micky Hammond.
The Middleham Jewel
The Middleham Jewel was discovered in 1985 by a metal detector-ist. It is a gold pendant with a sapphire stone from the late 1400s, which is now displayed in the Yorkshire museum in York.