Dunbar Castle was one of the strongest fortresses in Scotland, situated in a prominent position overlooking the harbour of the town of Dunbar, in East Lothian. Several fortifications were built successively on the site, near the English-Scottish border. The last was slighted in 1567; it is a ruin today.

Structure The body of buildings measured in excess of from east to west, and in some places up to from north to south. The South Battery, which Grose supposes to have been the citadel or keep, is situated on a detached perpendicular rock, only accessible on one side, high, and is connected to the main part of the castle by a passage of masonry measuring . The interior of the citadel measures within the walls. Its shape is octagonal. Five of the gun-ports remain, which are called the 'arrow-holes'. They measure at the mouth and only at the other end. The buildings are arched and extend from the outer walls, and look into an open court, whence they derive their light.Miller, James, The History of Dunbar, Dunbar, 1830, pps 2 – 6

About the middle of the fortress, part of a wall remains, through which there is a gateway, surmounted with armorial bearings. This gate seems to have led to the principal apartments. In the centre, are the arms of George, 10th Earl of Dunbar, who succeeded his uncle in 1369, and who besides the earldom of Dunbar and March, inherited the Lordship of Annandale and the Isle of Man from his heroic aunt, Black Agnes of Dunbar. They must have been placed there after his succession, as he was the first who assumed those sculptured Arms: viz, a large triangular shield, and thereon a lion rampant, within a bordure charged with eight roses. The shield is adorned with a helmet, carrying a crest: a horse's head bridled. On the right are the Arms of the Bruces, and on the left those of the Isle of Man.

The castle towers had communication with the sea, and dip low in many places. North-east from the front of the castle is a large natural cavern, chiefly of black stone, which looks like the mouth of the Acheron – a place that leads to melancholy streams. This spot is supposed to have formed part of the dungeon where prisoners were confined, such as Gavin Douglas, Bishop of Dunkeld, who was a prisoner here in 1515. There is, however, also a dark postern which gives access to a rocky inlet from the sea, and it seems probable that it was through this that Sir Alexander Ramsay and his followers entered with a supply of provisions to the besieged in 1338.

It was long said the castle was invulnerable, possibly because of the many sieges it sustained. The castle was built with a red stone similar to that found in the quarries near Garvald. Large masses of walls, which have fallen beneath the weight of time, appear to be vitrified or run together. In the north-west part of the ruins is an apartment about square, and nearly inaccessible, which tradition states was the apartment of Mary, Queen of Scots.

History Early history The Votadini or Gododdin are thought to have been the first to defend this site, as its original Brythonic name, dyn barr, means 'the fort of the point'. By the 7th century AD, Dunbar Castle was a central defensive position of the Kings of Bernicia, an Anglian kingdom that took over from the British kingdom of Bryneich.

Northumbria During the Early Middle Ages, Dunbar Castle was held by an Ealdorman owing homage either to the kings at Bamburgh Castle, or latterly to the kings of York. In 678 Saint Wilfrid was imprisoned at Dunbar, following his expulsion from his see of York by Ecgfrith of Northumbria.

Later, Dunbar is said to have been burnt by Kenneth MacAlpin, King of the Scots. Certainly he is on record as in possession of the castle.Miller, James, The History of Dunbar, Dunbar, 1830:8

Kingdom of the Scots In the 10th and early 11th centuries, the Norsemen made increasing inroads into Scotland, and in 1005 a record exists of a Patrick de Dunbar, under Malcolm II, engaged against the Norse invaders in the north at Murthlake, a town of Marr where he was slain alongside Kenneth, Thane of the Isles, and Grim, Thane of Strathearn.

The first stone castle is thought to have been built by Gospatric, Earl of Northumbria, after his exile from England, following the Harrowing of the North, by William the Conqueror after Gospatric took refuge at the court of Malcolm III of Scotland. Gospatric was a powerful landowner in both kingdoms and could summon many men, which encouraged Malcolm to give him more lands in East Lothian, the Merse and Lauderdale, as recompense for those lost further south and in return for loyalty, as was usual under the feudal system. Sir Walter Scott argued that Cospatric or Gospatrick was a contraction of Comes Patricius. In any case, King Malcolm III is recorded as bestowing the manor of Dunbar &c., on "the expatriated Earl of Northumberland".

In June 1338, Sir Alexander Ramsay of Dalhousie relieved Dunbar Castle and assisted the Countess of Dunbar ("Black Agnes of Dunbar"). Together they successfully defended the castle against the siege by William Montagu, 1st Earl of Salisbury of England.

James IV The castle remained the stronghold of the Earls of Dunbar until the forfeiture of George, Earl of March, in 1457, when the castle was dismantled to prevent its occupation by the English. It was restored by James IV later in the century. Andrew Wood of Largo was the keeper.Thomas Dickson, Accounts of Treasurer, vol. 1 (Edinburgh, 1877), p. 350: Exchequer Rolls, 11, p. 75. In April 1497 timber was bought for the "Hannis tower" and the master mason Walter Merlioun was completing the gatehouse or "fore work". Nails were bought for the "yetts" of the gatehouse, a wooden portcullis and a metal grille or yett made by Thomas Barker. John the Quarrier excavated a new well.Thomas Dickson, Accounts of Treasurer, vol. 1 (Edinburgh, 1877), pp. 328, 331, 334-5.

James IV visited in April 1497 and gave the masons drinksilver reward payments in May. On 20 August 1497, James IV met Sir William Tyler, the governor of Berwick, at Dunbar to discuss a truce.Norman MacDougal, James IV (Tuckwell, 1997), pp. 138–140: Thomas Dickson, Accounts of Treasurer, vol. 1 (Edinburgh, 1877), pp. clvi–clvii, 328, 337, 351, 353.Sean Cunningham, "National War and Dynastic Politics: Henry VII's Capacity to Wage War in the Scottish Campaigns of 1496–1497", Andy King and David Simpkin, England and Scotland at War (Brill, 2011), pp. 310–311.

Building lime was brought from Cousland, and received at Dunbar by Thomas Foret.Thomas Dickson, Accounts of Treasurer, vol. 1 (Edinburgh, 1877), pp. 343, 351. The hinges or "crukis" for the iron yett were made in the forge at Edinburgh Castle.Thomas Dickson, Accounts of Treasurer, vol. 1 (Edinburgh, 1877), p. 338. A carpenter, Patrick Falconer, measured the roof or ceiling of the king's chamber at Edinburgh Castle to make a similar roof at Dunbar.Thomas Dickson, Accounts of Treasurer, vol. 1 (Edinburgh, 1877), p. 339. In August 1497 two Dunbar carpenters, William Young and Thomas Makachane, started to roof the Hannis tower. In September it was finished by Andrew the "Sclater". Slates and rafters were brought to Dunbar in Will Merrymowth's boat.Thomas Dickson, Accounts of Treasurer, vol. 1 (Edinburgh, 1877), pp. 353, 355, 358-9. In 1501 new iron window grills or yetts were provided.James Balfour Paul, Accounts of the Treasurer, vol. 2 (Edinburgh, 1900), pp. 86, 101, 116.

Andrew Forman, Bishop of Moray, was made keeper of Dunbar Castle in September 1503.Register of the Privy Seal of Scotland, 1 (Edinburgh, 1908), p. 143 no. 978. Ferquhard Mackintosh, an heir to the Lordship of the Isles, was held prisoner in the castle for over ten years.Exchequer Rolls, 12 (Edinburgh, 1889), pp. 344–47.

James Stewart, Duke of Albany The castle came under the control of the Duke of Albany during the minority of James V. The garrison of 100 French soldiers was paid by Francis I of France, who sent their wages to the quartermaster Maurice de Nogent.Collection des ordonnances des rois de France: Catalogue des actes de François 1er, 6 (Paris, 1894), pp. 29–30 no. 19058 During this period the artillery bulwark to the west was built.Andrea Thomas, Princelie Majestie: The Court of James V (Edinburgh: John Donald), p. 165. It may have been designed by Antoine d'Arces, Sieur de la Bastie who was placed in charge of the castle in December 1514.Tabraham, Chris (1997) Scotland's Castles. Batsford. p.100 An English soldier, the Baron Dacre, visited and was impressed by the new "bulwerk".Bryony Coombs, Visual Arts and the Auld Alliance: Scotland, France and National Identity (Edinburgh, 2024), pp. 228–229. Albany organised further repairs and amendments in June 1527.State Papers Henry VIII, vol. 1 (London, 1830), p. 211, Knighte to Wolsey, 10 July 1527.

An Italian drawing for a fortification of this period by Antonio da Sangallo the Younger, marked as an opinion for "il Duca D'Albania," has been associated with Dunbar,Iain MacIvor, Fortified Frontier (Tempus, 2001), p. 69 (refers to Migliorino Ubaldini): Christoph Luitpold Frommel, The Architectural Drawings of Antonio Da Sangallo the Younger and His Circle: Fortifications, machines, and festival architecture (1994), p. 193. but may depict another project.Bryony Coombs, Visual Arts and the Auld Alliance: Scotland, France and National Identity (Edinburgh, 2024), pp. 232–233. An article by the historian Bryony Coombs further explores the activities of the Duke of Albany and his architectural and artistic connections that informed the design of the blockhouse and situates the building in a European context, and highlights the resemblance of the drawing to the Fort de Salses as built for Ferdinand II of Aragon.Bryony Coombs, 'John Stuart, Duke of Albany and his contribution to military science in Scotland and Italy 1514-36, from Dunbar to Rome', Proceedings of the Society of Antiquaries Scotland, 148 (2018), pp. 231-266, 247-8.

James V James V came to the castle frequently in the summer of 1537 after the death of his first wife, Madeleine of Valois, and oversaw the arrangement of his artillery. A Scottish courtier James Atkinhead was installed as captain.State Papers of Henry VIII, vol. 5 part 4 cont. (London, 1836), p. 94. In 1540, Aitkenhead's garrison included a number of foreign artillery and handgun experts, including Master Wolf, Morso or Marco of Armorica who was the armourer, Peter Cumbo, Tibo Rukour, John Rubino, and Peter Schoffett.Exchequer Rolls, 17 (Edinburgh, 1897), 278. The King's armourer, William Smeberd, refurbished weapons at Dunbar in August 1541 including halberds and "Jedburgh staves". Patrick Wemyss of Pittencrieff was captain of the castle in 1542 and spent £100 Scots on repairs.Exchequer Rolls, 18 (Edinburgh, 1898), 3, 37: Accounts of the Treasurer of Scotland, 7 (Edinburgh, 1907), p. 469.

Anglo-Scottish Wars of 1540s Dunbar Castle was involved in the war with England known as the "Rough Wooing". In July 1545 the Earl of Angus mentioned that Edinburgh Castle had been re-fortified, "but as for Dunbar he heard of nothing done to it".State Papers Henry VIII, vol. 5 (London, 1836), p. 468. French money amounting to £1,370 in 1546 was sent to fund repairs to the castle in 1546.James Balfour Paul, Accounts of the Lord High Treasurer of Scotland, vol. 9 (Edinburgh, 1911), p. 21. In August 1547 the cannon called "Thrawynmouth" was shipped from Dunbar for use at the siege of St Andrews Castle.Accounts of the Lord High Treasurer of Scotland, vol. 9 (Edinburgh, 1911), p. 103. Repair works were carried out by Robert Hamilton of Briggis.Accounts of the Treasurer, vol. 9 (Edinburgh, 1911), p. 445.