
Edinburgh, also known as Dun Eideann, is the capital of Scotland, located in Lothian. Edinburgh's name means "fort of Eidyn", referring to a fort on Castle Rock which protected the surrounding region of Eidyn. Edinburgh was founded before the 7th century AD, and the Angles controlled Lothian from 638 to 950, when the Scots reconquered Edinburgh. By 1124, Edinburgh was a burgh of the Kingdom of Scotland, and, by the 15th century, it was the principal burgh of Scotland. It was nearly destroyed during an English assault in 1544, and it later became the center of the Reformation in Scotland. In 1707, the union of Scotland and England as "Great Britain" led to riots in Edinburgh, as Scotland's Parliament was merged with the English Parliament. During the first half of the 18th century, Edinburgh was one of Europe's most densely populated, overpopulated, and unsanitary towns, but it came to be the heart of the Scottish Enlightenment in the second half of the century. The Industrial Revolution did not affect Edinburgh as much as other British cities, and, by 1821, Glasgow had surpassed Edinburgh as Scotland's largest city. The arrival of railways in the 1840s led to Edinburgh's growth, and, while Old Town became a slum due to industrialization, slum clearance in the 1960s and 1970s rescued the neighborhood. During the 1990s, a new financial district emerged, and, in 1998, a devolved Scottish Parliament and Executive were established and were based out of Edinburgh. In 2018, Edinburgh had a population of 518,500 people, while its metro area had 901,455 residents.