A sodomy law is a law that defines certain sexual acts as crimes. The precise sexual acts meant by the term sodomy are rarely spelled out in the law, but are typically understood by courts to include any sexual act deemed to be "unnatural" or "immoral". Sodomy typically includes anal sex, oral sex, and bestiality. In practice, sodomy laws have rarely been enforced against heterosexual couples, and have mostly been used to target homosexual couples.
As of July 2021, 68 countries as well as five sub-national jurisdictions have laws criminalizing homosexuality. In 2006 that number was 92. Among these 68 countries, 43 criminalize not only male homosexuality but also female homosexuality. In 11 of them, homosexuality is punished with the death penalty.: 15
In 2011, the United Nations Human Rights Council passed an LGBT rights resolution, which was followed up by a report published by the UN Human Rights Commissioner which included scrutiny of the mentioned codes.