Construction began in 1190 of Middleham Castle, which still dominates the town. The Nevilles, Earls of Westmorland, acquired it through marriage to a female descendant of Ribald in the 13th century. It has been dubbed the "Windsor of the North". The castle belonged to Richard Neville, 16th Earl of Warwick, when his cousin Richard, Duke of Gloucester (the future Richard III) came there to learn knighthood skills in 1462. During the Wars of the Roses, both Edward IV and Henry VI were held prisoner there. Richard, Duke of Gloucester, became master of the castle in 1471 after Warwick's death at the Battle of Barnet. He used it as his political base for ruling the North on behalf of his brother Edward IV. Richard married Warwick's daughter, Anne Neville, in 1472. Middleham Castle is where their son Edward was born in about 1473 and died in April 1484. Richard III, who died in August 1485 at the Battle of Bosworth, was the last reigning King of England to perish in battle.