The Sheriff of Edinburgh was historically the royal official responsible for enforcing law and order and bringing criminals to justice in the shire of Edinburgh (also known as Edinburghshire or Midlothian) in Scotland. In 1482 the burgh of Edinburgh itself was given the right to appoint its own sheriff, and thereafter the sheriff of Edinburgh's authority applied in the area of Midlothian outside the city, whilst still being called the sheriff of Edinburgh.[1][2] Prior to 1748 most sheriffdoms were held on a hereditary basis. From that date, following the Jacobite uprising of 1745, they were replaced by salaried sheriff-deputes, qualified advocates who were members of the Scottish Bar.
In 1872, following mergers, the sheriffdom became known as the sheriffdom of Midlothian and Haddington [3] After further reorganisations it became part of the sheriffdoms of The Lothians in 1881 and The Lothians and Peebles in 1883.