Sheriff of Ayr
The Sheriff of Ayr was historically (from 1221) the royal official responsible for enforcing law and order in Ayr, Scotland and bringing criminals to justice. Sundrum Castle was used by the sheriff from the 14th century, and Loudoun Castle from the 16th century. Prior to 1748 most sheriffdoms were held on a hereditary basis. From that date, following the Jacobite uprising of 1745, the hereditary sheriffs were replaced by salaried sheriff-deputes, qualified advocates who were members of the Scottish Bar.

In 1946 Bute was added to form the new sheriffdom of Ayr and Bute, which was in turn abolished in 1975 and replaced by the current sheriffdom of South Strathclyde, Dumfries and Galloway .

Sheriffs of Ayr
 
John of Moray (c.1170)
Reginald Crawford, (1221 – died 1226/1229)
Malcolm of Moray (1236)
Hugh Crawford (died 1265), Chief of Clan Crawford, Lord of Loudon Castle)
Walter Stewart, 1264
William Comyn (1263-1265)
Andrew Moray (1288)
James Stewart, 5th High Steward of Scotland (1288)
Reginald Crawford (1296)
Patrick IV, Earl of March (1301)
Robert de Brus (1303)
Magnus de Stratherne - 1303 - Deputy
Nicholas de Benhathe - 1303 - Deputy
Godfrey de Ros (1305–)
Robert of Laybourn (1306)
Robert Wallace (1342)
Duncan Wallace (1359)
John Wallace of Craigie 
Andrew Campbell of Loudoun (died 1368)
William Cunningham, Earl of Carrick (died between December 1396 and July 1399) (1374)
William de Cunningham (1406)
Hugh Campbell of Loudoun 
George Campbell of Loudoun (1450–1491)
Hugh Campbell (died 1508)
Hugh Campbell of Loudoun (1503–1561) 
Matthew Campbell of Loudoun (1561–1574)  
Mathew Baird, (1573)
Hugh Campbell of Loudoun (1574–15 Dec 1622) 1st Lord of Loudoun
William Cunningham, 9th Earl of Glencairn (1661-1664)
John Drummond, 1st Duke of Melfort (1686–1690) 
Sir George Campbell of Cesnock (1690-) 
Hugh, Earl of Loudoun (1699–1707)  
Robert Wallace c.1723
John, Lord Loudon (1747-1748)  

Sheriffs-Depute (1748)
William Duff, 1747–1775 
William Wallace, 1775–1786
William Craig, Lord Craig, 1787–1792
Edward McCormick, 1793–1814
Archibald Bell, 1815–>1852  (died 1854)
John Christison, <1861–1862 
Neil Colquhoun Campbell of Barnhill, 1862–1883
John Comrie Thomson, 1883–1885 
Sir David Brand, 1885–1908 
John Campbell Lorimer, 1908–1911 
William Lyon Mackenzie, 1911–1937
Arthur Paterson Duffes, KC, 1937–1946

Sheriffs of Ayr and Bute (1946)
Arthur Paterson Duffes, KC, 1946–1948 
Henry Wallace Guthrie, KC, 1948–1949 
James Frederick Gordon Thomson, KC, 1949–1952 
Christopher William Graham Guest, QC, 1952–1954 (Sheriff of Perth and Angus, 1954–)
Charles James Dalrymple Shaw, QC, 1954–1957 (Sheriff of Perth and Angus, 1957–)
John Oswald Mair Hunter, QC, 1957–1961  
Ian MacDonald Robertson, QC, 1961–1966  (Sheriff of Perth and Angus, 1966)
Robert Howat McDonald, QC, 1966–1972 
Donald MacArthur Ross, 1972–1973 
Robert Reid, 1973–1975 
 Sheriffdom abolished in 1975 and replaced by current sheriffdom of South Strathclyde, Dumfries and Galloway

See also
 Historical development of Scottish sheriffdoms

References

Ayrshire