Caerlaverock Castle dates back to around 1220AD, when King Alexander II of Scotland granted lands to Sir John Maxwell. He commenced work on a square-built, stone fortification, which was abandoned within 50 years (possibly due to flooding) in favour of a second site 200 meters to the north. Sir Aymer Maxwell began construction of a triangular castle (an unexplained choice, and unique in Britain) at this location, which was presumably complete by 1300AD when King Edward I laid siege to it with over 3000 men. The castle fell within two days, and remained in English hands for the next twelve years.
The English held the castle until 1312AD, at which time it was under the stewardship of Sir Eustace Maxwell (demonstrating the ever-shifting loyalties of the border lords). In that year, Sir Eustace declared for Robert the Bruce, King of the Scots, and was besieged by the English under Edward II. Caerlaverock held out, but Sir Eustace was subsequently forced to abandon it, demolishing it first to prevent its occupation by the English.
The castle was rebuilt at some point during the following years, changing hands a number of times as Scottish and English forces contested the region. Building work continued through into the 15th Century, with the gatehouse and south ranges dating back to this period.
History is quiet until the 16th Century, when renewed conflict between England and Scotland saw Caerlaverock Castle fall back into English hands following a siege in 1544AD. The castle fell to the Scots the following year, but was again besieged by the English in 1570AD.
The union of the English and Scottish crowns in 1603AD brought a brief period of peace to the region. It was during these years that Robert Maxwell built a modern mansion within the walls of the castle, presumably confident that the peace would hold. However, in 1640AD, Charles I attempted to force religious reform upon the Scots. The Maxwell family sided with the English, resulting in a final siege at Caerlaverock Castle. The castle held for thirteen weeks before being forced to surrender, and much of the damage evident today dates back to that period, when the house and fortification were rendered uninhabitable. The castle was never repaired, and subsequently fell into decay.
Today, Caerlaverock Castle presents a surprisingly well preserved set of ruins. The medieval walls survive in good repair on two sides. Robert Maxwell's Renaissance-style "Nithsdale Lodging" provides a striking contrast within, featuring ornate stonework and carvings. The whole affair sits within a moat, in a pleasant and relatively secluded corner of the Scottish countryside. However, this is a popular tourist destination, so will likely be busy unless you visit out of season. On the plus side, this means that there's also a decent café with outside seating and castle views. Also worth noting is the woodland walk, which leads to the still-visible foundations of the first castle.