The Sheriff of Elgin was historically the royal official responsible for enforcing law and order in Elgin, Scotland. 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.
After a merger the sheriff became the Sheriff of Elgin and Nairn in 1747. After further mergers the sheriffdom became part of the sheriffdom of Banff, Elgin & Nairn in 1854, part of the sheriffdom of Inverness, Elgin & Nairn in 1882 and part of the sheriffdom of Inverness, Moray, Nairn & Ross & Cromarty in 1946.