The name Loch Mhabain is possibly a corruption of Loch Mhaol Bheinn ("Lake on the bare mountain"), or may mean "Loch of Mabon", an ancient Brythonic god, as the Roman name of the area was Locus Maponi, according to the Ravenna Cosmography. It has been inhabited since earliest times due to its strategic position on the routes from England to Scotland and Ireland, to the small lochs surrounding it and to the relatively fertile soil in the area. The first inhabitants may have lived in crannogs in the lochs.
After the Roman departure from the area around Dumfries the locale had various forms of visit by Picts, Saxons, Scots and Danes culminating in a decisive victory over the native Britons in 890 for Giric mac Dúngail (Modern Gaelic: Griogair mac Dhunghail, known in English simply as Giric and nicknamed Mac Rath ("Son of Fortune"); fl. c. 878–889), who was a king of the Picts or the king of Alba, at what is now Lochmaben.
By 1160, the Anglo-Norman de Brus (Bruce) family had become the Lords of Annandale. Robert de Brus Lord of Skelton in the Cleveland area of Yorkshire, was a notable figure at the court of King Henry I of England, where he became intimate with Prince David of Scotland, that monarch's brother-in-law. When the Prince became King David I of Scotland, in 1124, Bruce obtained from him the Lordship of Annandale, and great possessions in the south of Scotland. (de Brus was nevertheless buried at Guisborough, the place of his birth). By the 15th century the Lordship was in the hands of Alexander Stewart, Duke of Albany. Following his death in 1485 it, and the castle of Lochmaben, were annexed to the Crown by Act of Parliament dated 1 October 1487.
At some point in the 13th century the Bruces built a castle, probably a Keep, at Lochmaben, the remains of which now lie under a golf course. It is claimed that King Robert I of Scotland (Bruce) was born there, which is why the town adopted the motto "From us is born the liberator king" (in Latin) on its coat of arms. However, this claim is relatively late; it cannot be ruled out, but his birthplace was more likely Turnberry Castle. Bruce certainly battled the English over this area during the Wars of Scottish Independence.
The English King Edward replaced the castle with a much sturdier structure at the south end of Castle Loch around 1300 and its remains still show the massive strength of its defences. Archibald Douglas, Lord of Galloway, with the assistance of the Earls of March and Douglas, after a siege of nine days, took Lochmaben Castle from the English and "razed it to the ground" on 4 February 1384/5. The castle and barony became a possession of the Earls of March, but when the 10th Earl was forfeited and then reinstated, in 1409, it is noted that it was "with the exception of the castle of Lochmaben and the Lordship of Annandale."
The Battle of Lochmaben Fair was fought on 22 July 1484: a force of 500 light horsemen led by Alexander Stewart, Duke of Albany and James Douglas, 9th Earl of Douglas invaded Scotland, but were defeated.
On 16 January 1508/9, at Edinburgh, Sir Robert Lauder of The Bass (d.1517/8), knight, was appointed "Captain and Keeper of the King's castle and fort of Lochmaben, with all pertinentes" and other privileges etc., for three years. In 1605 the Depute Lieutenant of the Borders, Sir William Cranstoun of that Ilk (later 1st Lord Cranstoun), was Keeper of Lochmaben Castle.
Lochmaben remained important and had a turbulent history until some time after the early 17th century by which time the castle had seen its last siege and was gradually abandoned.
The town had prospered and become a Royal Burgh in 1447, and a Royal Charter in 1579. Its importance waned with the peace that was to become the norm, but it had sufficient resources to build a substantial Tolbooth (later the village Hall) in 1723. The town is well found with a broad main street and the town is set in rolling countryside. The railway came in 1863, with Lochmaben a stop on the Dumfries to Lockerbie line, and brought easy communication both north and south. It closed to passengers in 1952 and to freight in 1966.
Lochmaben Hospital was opened in 1905 as an infectious diseases hospital but, with the virtual demise of these diseases, it is now a modern 16 bed community facility caring for both physical and psychiatric problems.
There is also a doctors surgery.
Lochmaben Primary School is one of the largest in Annandale. The school moved to new premises in 1982.
It also has an 18-hole golf course surrounding the Kirk loch on the edge of the town. Lochmaben has 3 main lochs: Kirk Loch, Castle Loch and the Mill Loch. It also has 2 smaller lochs: The Blind Loch and the Upper Loch. The town’s lochs thrive with both sailing and fishing taking place throughout the year. In some years in winters of prolonged frost curling has taken place on the frozen lochs, mostly the Kirk Loch.
A 53-mile long-distance walking route called Annandale Way running through Annandale (from the source of the River Annan to the sea) was opened in September 2009. The route passes through Lochmaben and along the bank of Castle Loch. It offers interesting walking from Lochmaben on a day walk basis.
There are 2 convenience stores at each end of the town. Several successful businesses are also in the town and the town is once again thriving with many houses planned to be built over the next ten years. There is also a Post Office.
The town has suffered genteel poverty in past times but it now prospers on a mix of agriculture, light industry and tourism with significant numbers commuting the short distance to Dumfries.
Many inhabitants commute to the nearby Arla Foods factory, which produces 2 million bottles of milk per week.William Wright Smith, botanist
Angus Douglas – Scottish international footballer
Maitland Pollock – professional footballer