Throughout its long history, Thirlestane belonged to the Maitland family, one of the most able and famous in Scotland. The Maitlands came to Britain from France with William the Conqueror in 1066, and settled in Northumberland. In about 1250, Sir Richard Maitland married Avicia, the daughter and sole heiress of Thomas du Thirlestane. It was this marriage that brought the lands of Thirlestane and others into the ownership of the Maitland family. The ruined remains of one of the family homes at that time can still be seen, two miles from the Castle off the A697.
Through military service and their contributions to law and the arts, the Maitlands gained increasing influence and power. In 1590, John Maitland became Lord Chancellor of Scotland. His son was created 1st Earl of Lauderdale and his brother, William Maitland, was Secretary to Mary Queen of Scots.
John Maitland, 2nd Earl of Lauderdale, was one of the most important and controversial Scottish figures of the late 17th century. As a leading royalist, he was a confidant of King Charles II and spent nine years in the Tower of London under sentence of death. After the Restoration, he was appointed Secretary of State for Scotland. As such, he was virtually the uncrowned King of Scotland, and wielded unrivalled power and influence.
On his second marriage to the Countess of Dysart, he was created Duke of Lauderdale and began transforming Thirlestane Castle into a fitting palace from which to direct the affairs of Scotland. He employed Sir William Bruce to undertake the remodelling of the Castle. Bringing Renaissance influences to the Scottish Baronial style, he introduced the two front towers and the grand staircase and oversaw the transformation of the interior, the most remarkable feature of which is the rich plasterwork of the State Rooms.
By 1679, Lauderdale had lost his ability to influence the Scots parliament and to keep order in Scotland as the Covenanting insurrection spread. The Duke of Monmouth was successful in restoring order. James, Duke of York (later James VII) took up residence in Edinburgh, whilst Lauderdale remained in office as Secretary. Early in 1680, he suffered a stroke. In October that year, he resigned, retiring to Tunbridge Wells to take the waters and died there in August 1682. The Dukedom died with him and his brother Charles became the 3rd Earl of Lauderdale.
By the 19th century, Thirlestane's role had evolved in more peaceful times to that of a Scottish country mansion for the Earls of Lauderdale. The social use to which the Castle was now put required more space, so in 1840 the Edinburgh architects, David Bryce and William Burn, were employed to design two large wings flanking the central Keep. The south wing, constructed around a central courtyard, housed new kitchens, pantries, laundries and servants' accommodation. The exterior remodelling highlighted the earlier features, with the new towers designed to match the outer towers of the Keep. The interior work also remained sympathetic to the work of Sir William Bruce, introducing the comforts of the Victorian age while retaining the magnificent features of the Baroque.