Sodomy, also known as buggery, was a crime in England and Wales from the Buggery Act 1533. The Act (and subsequent Acts) did not define what was meant by sodomy, but the courts interpreted it to mean anal intercourse.
The word is derived from Sodom, one of the "cities of the plain" (along with Gomorrha) which according to the Bible were destroyed by God because of the wickedness of their inhabitants. Specifically the book of Genesis relates that when three visitors (traditionally interpreted as angels) came to stay with Lot, the men of Sodom called to him "Where are the men which came in to thee last night? Bring them out to us, that we may know them." This passage has been been taken condemning homosexuality, but an alternative view is that the Sodomites' guilt lay in breaking the law of hospitality, rather than for the specific sexual aspect.
Sodomy carried the death penalty until 1861, but was difficult to prove. In 1885 Parliament enacted the Labouchere Amendment which prohibited gross indecency between males, making gay sex much easier to prosecute.
Sodomy remained a crime until 1967 in England, and up until 1992 in the Isle of Man. In Jersey, sodomy, referred to in legal French as the crime of sodomie was totally illegal for both men and women until 1990.
Gabriel Lawrence, Thomas Wright and William Griffin were hanged for the crime of sodomy in 1726 following a raid at a Molly House. William Griffin was found guilty of attempted sodomy in Moorfields with Thomas Newton and he was fined, pilloried and imprisoned.
In 1785 Jeremy Bentham was one of the first people to argue for the decriminalisation of sodomy in England.