Earl of Pembroke recaptured Dirleton once more. It was finally retaken by the Scots some time before 1314, and was slighted, or deliberately damaged, to prevent its reuse by the English. Haliburton The castle and lands of Dirleton passed to the Berwickshire family of Haliburton (or Halyburton) when John Haliburton (d.1355) married the heiress of the de Vaux family, shortly before 1350. The castle had been repaired by 1363, when it was seized by William Douglas, 1st Earl of Douglas, during his brief rebellion against King David II, although it was later returned to the Haliburtons. In the 1420s, Sir Walter Haliburton (d. before 1447) acted as a hostage in exchange for the release of King James I, who had been held captive by the English since 1406. He was rewarded in 1439 by being appointed Treasurer of Scotland. Either Walter, or his eldest son John (d. before 1454), was ennobled as a Lord of Parliament in the 1440s, with the title Lord Dirletoun. The Haliburtons carried out extensive works at Dirleton, heightening the original towers, and constructing a new gatehouse to the south-east. A large hall and tower house were added to the castle in the 15th century, forming the east range. King James IV visited Dirleton in September 1505, and gave money to the masons then engaged on works in the north-east part of the castle. Later that year, Patrick, the last Haliburton of Dirleton, died, and his estates were divided among his three daughters, Janet, Margaret, and Mariotta. James IV made Patrick Haliburton's widow Christiane Wawane and her brother William Wawane keepers of Dirleton in August 1507. Ruthven The eldest daughter, Janet, married William Ruthven, 2nd Lord Ruthven (d. 1552) in 1515, and the castle and lordship of Dirleton passed to the Ruthven family. The son of William and Janet, Patrick, 3rd Lord Ruthven (c. 1520–1566), was one of the leaders of the group who murdered David Riccio, private secretary to Mary, Queen of Scots, in 1566. Patrick was forced to flee to England, where he died, leaving Dirleton to his son William (c. 1541–1584), who was created Earl of Gowrie in 1581. Lord Gowrie led a plot, later known as the Raid of Ruthven, in which the 16-year-old King James VI was seized, in August 1582. Ruthven then ruled in the king's name, while James was held captive. Although Gowrie was pardoned the following year, he