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 Clan Douglas 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.
In 1642, Dalkeith Castle was sold by the Douglas family to Francis Scott, 2nd Earl of Buccleuch. The 2nd Earl of Buccleuch's daughter married the Duke of Monmouth, eldest illegitimate son of King Charles II. They became the Duke and Duchess of Monmouth & Buccleuch. After the Duke of Monmouth had been executed for treason, Anne Scott, 1st Duchess of Buccleuch, his widow, who held the Scottish title in her own right, asked architect James Smith to use William of Orange's Palace of Het Loo in the Netherlands as a model for the new Dalkeith Palace.
Smith and his cousins, Gilbert and James, signed the contract for mason work at Dalkeith Castle in March 1702. Construction of Dalkeith Palace began later that year, Smith deciding to incorporate a portion of the tower house of the old castle into the western side of the new structure. The outline of the old tower walls is still visible in the western facade of the palace today.
The 5th Duke of Buccleuch considered extensive rebuilding in 1831 and William Burn produced unexecuted designs in Jacobean style. More minor alterations were carried out, together with improvements to the surrounding estate including a new house and offices for the Duke's Chamberlain, and the construction, for the 5th Duke, of St Mary's Church as a private chapel by William Burn and David Bryce. The church contains one of only two water-powered organs in Scotland.
References:The Château du Lude is one of the many great châteaux of the Loire Valley in France. Le Lude is the most northerly château of the Loire Valley and one of the last important historic castles in France, still inhabited by the same family for the last 260 years. The château is testimony to four centuries of French architecture, as a stronghold transformed into an elegant house during the Renaissance and the 18th century. The monument is located in the valley of Le Loir. Its gardens have evolved throughout the centuries.