The United Nations said Monday it was "alarmed" by a new law in Iraq criminalising same sex relations and called for them to be shelved.
Homosexuality is taboo in Iraq's conservative society. However, there had not previously been a law that explicitly punished same-sex acts.
"We are alarmed by the passing of a new law by Iraq's parliament that criminalises consensual same-sex relations as well as other forms of private consensual behaviour with jail terms of up to 15 years," UN human rights office spokeswoman Ravina Shamdasani said in a statement.
"The law runs contrary to several human rights treaties and conventions ratified by Iraq, including the International Covenant on Civil and Political Rights, and should be shelved."
Transgender people will be sentenced to three years' jail under the amendments to a 1988 anti-prostitution law.
The amendments also set a minimum seven-year prison term for "promoting" same-sex relations and a sentence ranging from one to three years for men who "intentionally" act like women.
"There is extensive evidence that such laws also legitimise prejudice, expose people to hate crime, police abuse, harassment, intimidation, blackmail and torture," Shamdasani said.
"Furthermore, they perpetuate discrimination and denial of access to basic services, including in healthcare, education and housing."
She said everyone had the right to protection from discrimination on grounds including sexual orientation and gender identity.
The amended law makes "biological sex change based on personal desire and inclination" a crime and punishes transgender people and doctors who perform gender-affirming surgery with up to three years in prison.
The amendments also ban organisations that "promote" homosexuality and punish "wife swapping" with a prison sentence of 10 to 15 years.