A sheriff is in principle a legal official with responsibility for a county. In practice, the specific combination of legal, political, and ceremonial duties of a sheriff varies greatly from country to country.
The word "sheriff" is a contraction of the term "shire reeve". The term, from the Old English scīrgerefa, designated a royal official responsible for keeping the peace (a "reeve") throughout a shire or county on behalf of the king. The term was preserved in England notwithstanding the Norman Conquest. From the Anglo-Saxon kingdoms the term spread to several other countries, at an early point to Scotland, latterly to Ireland and the United States.
The position of sheriff now exists in various countries:
- Sheriffs are administrative legal officials (similar to bailiffs) in Ireland, Australia, and Canada.
- Sheriffs are judges in Scotland.
- Sheriff is a ceremonial position in England, Wales, and India.
- In the United States of America the role of a sheriff varies between different states and counties. The sheriff is a county official, the arm of the county court. In urban areas they may be restricted to these court duties, such as administering the county jail, courtroom security, prisoner transport, serving warrants, service of process or police administration. Sheriffs may also patrol outside of city/town limits or jurisdiction. In many rural areas, sheriffs and their deputies are the principal form of police.
Main articles: Sheriff Court and Sheriff PrincipalSee also: Scots law In Scotland, a sheriff is analogous to a judge and sits in a second-tier court, called the Sheriff Court. The sheriff is legally qualified, in comparison with a lay Justice of the Peace who preside over the first-tier District Courts of Scotland.
The sheriff court is a court of first instance for the majority of both civil and criminal cases. However, the court's powers are limited, so that major crimes such as rape or murder and complex or high-value civil cases are dealt with in the High Court (for criminal matters) or the Court of Session (for civil matters).
There are six sheriffdoms in Scotland, each with a Sheriff Principal. Within each sheriffdom there are several Sheriff Courts; each court has at least one courtroom and at least one Sheriff (technically a Sheriff Depute). A Sheriff may sit at different courts throughout the sheriffdom. 
Sheriffs are usually advocates and, increasingly, solicitors with many years of legal experience. Until recently, they were appointed by the Scottish Executive, on the advice of the Lord Advocate. However, the Scotland Act 1998 introduced the European Convention of Human Rights into Scots law. A subsequent legal challenge to the impartiality of the sheriffs based on the provisions of the Convention led to the setting up of the Judicial Appointments Board for Scotland, which now makes recommendations to the First Minister, who nominates all judicial appointments in Scotland other than in the District Court. Nominations are made to the Prime Minister, who in turn makes the recommendation to the Queen.