until the fourteenth and fifteenth centuries, when the failure to make a permanent settlement following the 'wars of independence' (the excellent and statesmanlike Treaty of Edinburgh of 1328 lasted precisely four years and three months)11 had the effect of placing the entire Border region, both north and south of the line, on a war footing. In the earlier period the Border had been surprisingly unmilitary. On the Scottish side there were royal castles (early twelfth century?) at Berwick upon Tweed, Roxburgh and Jedburgh - all on the east. Carlisle castle, first built by the English king William Rufus in 1092, was actually in Scottish hands from 1136 to 1157. About ten years later the king of Scots, William the Lion, seems to have built the earliest royal castle at Dumfries11 12. 'Private' castles on the Scottish side were not numerous: Hawick had a motte (and bailey?) fortification built by the Lovels c. 1150,13 the de Soules lords of Liddesdale had another motte at Castleton dating from the same period, and built the earliest phase of Hermitage Castle c. 124414. The Maxwells began the splendid castle at Caerlaverock at about the same time.15 The Bruce family, to whom David I had given the whole of Annandale c. 1124, had two castles, at Annan and Lochmaben, the former of which seems to have been contemporary with the king's grant, while the latter was in existence well before 1173-416. On the English side, in the period before the wars of independence, fortification was even less impressive, and shows little sign of having been planned with an eye to the Border as a whole. The land immediately south of the Tweed, as far upstream as Comhill, formed part of the palatinate bishopric of Durham, and attempts by the Crown to erect a castle at Tweedmouth, opposite Berwick, during vacancies of the see came to nothing, chiefly because of Scottish opposition17. In 1121 Bishop Ranulf ('Flambard') built the massive castle of Norham which still survives and which proved a thorn in the side of the Scots over many centuries18. Further south were the royal castles of Bamburgh and Newcastle upon Tyne, the former of which (like its fourteenth-century companion at Dunstanburgh) lay too far to the east to present much of a threat to Scots invaders. Otherwise, Northumberland was relatively well supplied with baronial castles, few of which seem to be closely related to the Border save for the fact that they are almost invariably located south of the rivers or watercourses with which they are 11 Nicholson, R., Scotland: The Later Middle Ages, 127-9. 12 Scott, J.G., "An early sheriff of Dumfries?", Transactions of the Dumfriesshire and Galloway Natural History and Antiquarian Society, 3rd ser., 57 (1982), 90-91. 13 Royal Commission on the Ancient and Historical Monuments of Scotland, Inventory of Monuments of Roxburghshire, I, 135 (no. 233). 14 Ibid., 82-3 ; Bartlett and Mackay, Medieval Frontier Societies, 11. 15 Ibid. ^ Simpson, G.G. and Webster, B., "Charter Evidence and the Distribution of Mottes in Scotland", Ch√Ęteau Gaillard (1972), 177-8; Gesta Regis Henrici Secundi Benedict! Abbatis, ed. Stubbs, W. (Rolls Series, 1867), I, 48. 17 Duncan, A.A.M., Scotland: The Making of the Kingdom (1975), 242-8. 18 Barrow, G.W.S., The Kingdom of the Scots (1973), 155. 201