Dunbar Castle is the remnants of one of the most mighty fortresses in Scotland, situated over the harbour of the town of Dunbar, in East Lothian.
The Votadini or Gododdin, are thought to have been the first to defend this site, the |Brythonic name Dyn Barr, (the fort of the point) is still in use. By the 7th century Dunbar Castle was a central defensive position of the Kingdom of Bernicia an Anglian kingdom that took over from the British Kingdom of Bryneich. During the Early Middle Ages, Dunbar Castle was held by an Ealdorman owing homage to either the Kings at Bamburgh Castle, or latterly the Kingdom of York. In 678 Saint Wilfrid was imprisoned at Dunbar, following his expulsion from his see of York by Ecgfrith of Northumbria. Later, Dunbar was said to have been burnt by Kenneth MacAlpin, King of the Scots. Certainly he is on record in possession of the castle.<ref>Miller, James, The History of Dunbar, Dunbar, 1830, p8</ref>
Kingdom of the Scots
In the 10th and early 11th century the Norsemen made increasing inroads in Scotland, and in 1005 there is record of a Patrick de Dunbar, under Malcolm II, engaged against the Norse invaders in the north, at Dufftown, a town of Marr, where, alongside Kenneth, Thane of the Isles, and Grim, Thane of Strathearn, he was slain.<ref>Miller, James, The History of Dunbar, Dunbar, 1830, p8</ref>
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 the Merse and Lauderdale, in return for those lost further south in return for loyalty. 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, on "the expatriated Earl of Northumberland"