David I lived from 1080 to 24 May 1153 and was King of Scotland from 23 April 1124 to 24 May 1153. The wider picture in Scotland at the time is set out in our Historical Timeline. David was the sixth son of Malcolm III and Margaret, and taking both Malcolm's marriages into account was the fourth of Malcolm's sons to sit on the throne of Scotland.
When his older brother, King Edgar, died he bequeathed only the northern half of his Kingdom to another brother, Alexander I. The lands south of the Forth and Clyde were made into a separate earldom and placed in the care David. On Alexander's death in 1124, David I took full control of Scotland.
David had spent part of his youth at the court of his brother in law, Henry I of England. And in 1113 he had married Matilda, daughter of Waltheof, Earl of Huntingdon. As a result David himself controlled the Earldom of Northampton and its huge estates in southern England.
David I was noted for his piety: indeed some felt him too pious to be a good ruler. He was responsible for the founding of many abbeys including Holyrood, Melrose and Dryburgh, and sees like Caithness, Dunblane and Aberdeen. This was not always as unworldly as it seemed. The monasteries significantly improved the economy of Scotland by their innovations in areas like sheep farming, coal working and salt producing.
David also founded a series of royal burghs like Stirling, Perth and Dunfermline; he was responsible for Scotland's first coinage; and he brought many Anglo-Normans into the southern half of the country to help with the process of government. In around 1130 David took direct control of Moray after a revolt against him there, doing away with the hereditary sub-kingship that had previously wielded much influence there.
Henry I of England died in 1135. The claim to the throne of his daughter, Matilda against the usurper Stephen, was supported by David I, who was also her uncle. David invaded northern England in support of Matilda's claim to the English throne. On 22 August 1138 David was defeated at the Battle of the Standard, near Northallerton in Yorkshire. Nonetheless, he was still able to ensure that the Treaty of Durham in 1139 granted Northumberland to the Scots. Ten years later he gained the agreement of Matilda's son, the future Henry II of England, that Scotland could retain Northumberland, Cumberland and Westmorland.
David died in Carlisle on 24 May 1153, aged about 73, before being buried in Dunfermline. His last surviving son Henry had died the previous year, so David was succeeded by Henry's son, Malcolm, Earl of Huntingdon, who became Malcolm IV.