their lineage, and marking the beginning of the end of Pictish culture. The kingdom of Cináed and his descendants, called Alba, was Gaelic in character but existed on the same area as Pictland. By the end of the tenth century, the Pictish language went extinct as its speakers shifted to Gaelic. From a base in eastern Scotland north of the River Forth and south of the River Spey, the kingdom expanded first southwards, into the former Northumbrian lands, and northwards into Moray. Around the turn of the millennium, there was a centralization in agricultural lands and the first towns began to be established. In the twelfth and thirteenth centuries, much of Scotland was under the control of a single ruler. Initially, Gaelic culture predominated, but immigrants from France, England and Flanders steadily created a more diverse society, with the Gaelic language starting to be replaced by Scots. Altogether, a modern nation-state emerged from this. At the end of this period, war against England started the growth of a Scottish national consciousness. David I (1124–1153) and his successors centralized royal power and united mainland Scotland, capturing regions such as Moray, Galloway, and Caithness, although he did not succeed at extending his power over the Hebrides, which had been ruled by various Scottish clans following the death of Somerled in 1164. The system of feudalism was consolidated, with both Anglo-Norman incomers and native Gaelic chieftains being granted land in exchange for serving the king. The complex relationship with Scotland's southern neighbour over this period is characterised by Scottish kings making successful and unsuccessful attempts to exploit English political turmoil, followed by the longest period of peace between Scotland and England in the mediaeval period: from 12171296. The death of Alexander III in March 1286 broke the succession line of Scotland's kings. Edward I of England arbitrated between various claimants for the Scottish crown. In return for surrendering Scotland's nominal independence, John Balliol was pronounced king in 1292. In 1294, Balliol and other Scottish lords refused Edward's demands to serve in his army against the French. Scotland and France sealed a treaty on 23 October 1295, known as the Auld Alliance. War ensued, and John was deposed by Edward who took personal control of Scotland. Andrew Moray and William Wallace initially emerged as the principal leaders of the resistance to English rule in the Wars of Scottish Independence, until Robert the Bruce was