Coordinates: 55°53′58″N 3°4′4″W / 55.89944°N 3.06778°W
Dalkeith Palace in Dalkeith, Midlothian, Scotland, is a historic house and the former seat of the Duke of Buccleuch. The present house was built in 1702 on the site of an earlier castle.
Dalkeith Castle was located to the north east of Dalkeith, and was originally in the hands of the Clan Graham in the 12th century and given to the Douglas family in the early 14th century. James Douglas of Dalkeith became the Earl of Morton in the mid 15th century. The castle was strategically located in an easily defensible position above a bend in the River North Esk. Nearer the centre of Dalkeith, James Douglas, 1st Lord Dalkeith, endowed the collegiate church in 1406, where Douglas earls lords and knights were buried.
Margaret Tudor, the bride of King James IV of Scots, stayed here as the guest of the Earl of Morton before her formal entry to Edinburgh in 1503. In 1543, David, Cardinal Beaton, the Archbishop of St Andrews, was imprisoned in Dalkeith Castle. The castle was captured during the war of the Rough Wooing by the English soldiers James Wilford and Thomas Wyndham on 3 June 1548.