Midlothian (mɪdˈloʊðiən; Meadhan Lodainn) is a historic county, registration county, lieutenancy area and one of 32 council areas of Scotland used for local government. Midlothian lies in the east-central Lowlands, bordering the City of Edinburgh council area, East Lothian and the Scottish Borders.
Midlothian emerged as a county in the Middle Ages under larger boundaries than the modern council area, including Edinburgh itself. The county was formally called the "shire of Edinburgh" or Edinburghshire until the twentieth century. It bordered West Lothian to the west, Lanarkshire, Peeblesshire and Selkirkshire to the south, and East Lothian, Berwickshire and Roxburghshire to the east. Traditional industries included mining, agriculture and fishing – although the modern council area is now landlocked.
Following the end of the Roman occupation of Britain, Lothian was populated by Brythonic-speaking ancient Britons and formed part of Gododdin, within the Hen Ogledd or Old North. In the seventh century, Gododdin fell to the Angles, with Lothian becoming part of the kingdom of Bernicia. Bernicia united into the Kingdom of Northumbria which itself became part of the early Kingdom of England. Lothian came under the control of the Scottish monarchy in the tenth century.
In the Middle Ages, Lothian was the scene of several historic conflicts between the kingdoms of Scotland and England. The Battle of Roslin took place in 1303 at Roslin as part of the First War of Scottish Independence. A Scottish army led by Simon Fraser and John Comyn defeated an army led by English commander John Segrave.
Along with other parts of the Lothians, the county was involved in the Rough Wooing when Roslin Castle, seat of the Earl of Caithness, was destroyed in 1544 by forces of Henry VIII of England.
In the 17th century, the county featured in the War of the Three Kingdoms, where General George Monck had his base at Dalkeith Castle as the Commonwealth's Commander in Scotland.