At His Majesty's pleasure

At His Majesty's pleasure (when the reigning monarch is female, at Her Majesty's pleasure), sometimes abbreviated to the King's pleasure (or the Queen's pleasure), is a legal term of art referring to the indeterminate or undetermined length of service of certain appointed officials or the indeterminate sentences of some prisoners. It is based on the proposition that certain government officials are appointed by the Crown and can be removed for policy reasons, unlike employees. Originating in the United Kingdom, the phrase is now used throughout the Commonwealth realms, Lesotho, Eswatini, Brunei, and other monarchies, such as Spain, the Netherlands, and Oman. In realms where the monarch is represented by a governor-general, governor, or administrator, the phrase may be modified to be at the governor's pleasure or variations thereof, since the governor-general, governor, lieutenant governor, or administrator is the king's personal representative in the country, state, or province.

Service to the Crown
People appointed by the sovereign to serve the Crown and who have no set limit to the time they occupy their given office—for example, governors-general and minister of the Crown—are said to serve at His Majesty's pleasure. In Canada, provincial lieutenant governors are appointed by the Canadian monarch's federal representative, the governor general, and are, thus, described in the Constitution Act, 1867, as holding office "during the pleasure of the governor general". Similarly, Australian ministers of state are, by the Commonwealth of Australia Constitution Act 1900, appointed to serve "during the pleasure of the governor-general".

Incarceration
The term is used to describe detention in prison for an indefinite length of time; a judge may rule that a person be "detained at His Majesty's pleasure" for serious offences or based on a successful insanity defence. This is sometimes used where there is a great risk of re-offending. However, it is most often used for juvenile offenders, usually as a substitute for life sentencing (which might be much longer for youthful offenders). For example, section 259 of the United Kingdom's Sentencing Act 2020 (which only applies to England and Wales) states, "where [...] a person convicted of murder, or any other offence the sentence for which is fixed by law as life imprisonment, and the person appears to the court to have been aged under 18 at the time the offence was committed. The court must sentence the offender to be detained during Her Majesty's pleasure."

Prisoners held at His Majesty's pleasure are periodically reviewed to determine whether their sentence can be deemed complete; although this power traditionally rested with the monarch, such reviews are now made by in the name of the monarch, on the advice of government officials — the Secretary of State for Justice in England and Wales, for instance. Minimum terms are also set, before which the prisoner cannot be released; in England and Wales, these were originally set by the home secretary, but, since 30 November 2000, have been set by the trial judge. Prisoners' sentences are typically deemed to be complete when the reviewing body is "satisfied that there has been a significant change in the offender's attitude and behaviour".

Derivatives
In Commonwealth republics, such as Botswana, India, Kenya, Pakistan, Singapore, and South Africa, the phrase is "during the president's pleasure". This term is also applied to other republics that are outside of the Commonwealth, such as Brazil, Egypt, Finland, France, Iceland, Ireland, Italy, South Korea, Mexico, Montenegro, and Serbia.

In Hong Kong, following the transfer of its sovereignty to China in 1997, the term was modified to "at executive discretion" (等候行政長官的酌情決定). Subsequently, this was held, by Judge Michael Hartmann, in the case Yau Kwong Man v. Secretary for Security, to be incompatible with the separation of powers enshrined in the Basic Law.

In Malaysia, at the federal level, the term used is "at the pleasure of the Yang di-Pertuan Agong" and "at the pleasure of the sultan/ruler/governor", at the state level.

In the United States, Russia, and the Philippines, the equivalent standard for political appointments is called "at the pleasure of the president" (по усмотрению президента; Sa kasiyahan ng Pangulo).