The death penalty for homosexuality has historically been implemented by a number of regimes worldwide. It is currently still extant in a fairly small number of countries or parts of countries, all due to sharia law. Even though the law may allow the death penalty it does not mean that it is carried out. Conversely de facto death penalties may apply, for example the Washington Post said that in Iraq "The penal code does not expressly prohibit homosexual acts, but people have been killed by militias and sentenced to death by judges citing sharia law."
There is legal dispute whether the law of the United Arab Emirates allows for the death penalty for homosexuality, however Amnesty International could find no instances of the death penalty.
Australian states and territories inherited British laws relating to homosexuality, and laws passed in nineteenth century colonial parliaments retained the provisions which made homosexual activity a capital crime. Over time, various jurisdictions began to reduce the death penalty for sodomy to life imprisonment, with Victoria being the last to remove the death penalty for this crime, in 1949.
From 1533 it was a capital felony for any person to "commit the detestable and abominable vice of buggery with mankind or beast," was repealed and re-enacted several times, until it was reinstated in 1563 remaining unchanged until 1861.
Colonial America had the laws of the United Kingdom, and the revolutionary states took many of those laws as the basis of their own, in some cases verbatim. The last law where the death penalty was on the statute books was South Carolina, the old British law was repealed until 1873, twelve years after the mother country.
The number of times the penalty was carried out is unknown. Records support two executions, and a number of more uncertain convections, such as "crimes against nature".