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.
As of August 2016, 72 countries as well as five sub-national jurisdictions have laws criminalizing homosexuality, with most of them located in Asia and Africa. In 2006 that number was 92. In 2011, the United Nations Human Rights Council passed a LGBT rights resolution, which was followed up by a report published by the UN Human Rights Commissioner which included scrutinisation of the mentioned codes.
The Middle Assyrian Law Codes (1075 BC) state: If a man has intercourse with his brother-in-arms, they shall turn him into a eunuch. This is the earliest known law condemning the act of male-to-male intercourse in the military.
In the Roman Republic, the Lex Scantinia imposed penalties on those who committed a sex crime (stuprum) against a freeborn male minor. The law may also have been used to prosecute male citizens who willingly played the passive role in same-sex acts. The law was mentioned in literary sources but enforced infrequently; Domitian revived it during his program of judicial and moral reform. It is unclear whether the penalty was death or a fine. For adult male citizens to experience and act on homoerotic desire was considered natural and permissible, as long as their partner was a male of lower social standing.Pederasty in ancient Rome was acceptable only when the younger partner was a prostitute or slave.