These were retained in the criminal codes passed by the various colonial parliaments during the 19th century, and by the state parliaments after Federation. This defence was initiated as a bill by Murray Hill, father of former Defence Minister Robert Hill , and repealed the state's sodomy law in The Campaign Against Moral Persecution during the s raised the profile and acceptance of Australia's gay and lesbian communities, and other states and territories repealed their laws between and The exception was Tasmania , which retained its laws until the Federal Government and the United Nations Human Rights Committee forced their repeal in Male homosexuality was decriminalised in the Australian Capital Territory in , then Norfolk Island in , following South Australia in and Victoria in At the time of legalization for the above , the age of consent, rape, defences, etc.
Then since , the states and territories that retained different ages of consent or other vestiges of sodomy laws have tended to repeal them later; Western Australia did so in , and New South Wales and the Northern Territory did so in Tasmania was the last state to decriminalise sodomy, doing so in after the groundbreaking cases of Toonen v Australia and Croome v Tasmania it is also notable that Tasmania was the first jurisdiction to recognize same-sex couples in Australia since under the Relationships Act LGBT rights in Brazil and Legal status of homosexuality in Brazil Brazilian criminal law does not punish any sexual act performed by consenting adults, but allows for prosecution, under statutory rape laws, when one of the participants is under 14 years of age and the other an adult, as per Articles A of the Brazilian Penal Code.
Pedophilic acts are also criminalized by the Children and Teenager Statute, in articles A to E. Since the article is entitled Of pederasty or other libidinous acts, gay rights advocates claim that, since the Brazilian armed forces are composed almost exclusively of males, the article allows for witch-hunts against homosexuals in the military service.
In , the Province of Canada enacted its own buggery law in the Consolidated Statutes of Canada as an offence punishable by death.
Buggery remained punishable by death until A broader law targeting all homosexual male sexual activity "gross indecency" was passed in , as part of a larger update to the criminal law of the new dominion of Canada.
Most famously, George Klippert , a homosexual, was labelled a dangerous sexual offender and sentenced to life in prison, a sentence confirmed by the Supreme Court of Canada. The offences of buggery and "gross indecency" were still in force, however the new act introduced exemptions for married couples, and any two consenting adults above the age of 21 regardless of gender or sexual orientation.
The bill had been originally introduced in the House of Commons in by then Minister of Justice Pierre Trudeau ,  who famously stated that "there's no place for the state in the bedrooms of the nation". In the Court of Appeal for Ontario case R. The Court of Queen's Bench of Alberta declared section in its entirety to be null, including the provisions criminalizing the act when more than two persons are taking part or present.
It is still banned if one of the persons is below the age of 18, however, even though the age of consent is The Chinese Supreme Court ruled in that voluntary sodomy was not a criminal act. Private sex between unmarried people was illegal until In a notable case in , a man who had anal intercourse with a teenager was sentenced to three and a half years in prison.