Iraq's parliament has passed a bill criminalising same-sex relationships with jail terms of between 10 and 15 years.
Transgender people could also be sent to prison for between one and three years under the new law.
Supporters of the changes say they will help to uphold religious values in the country.
Rights groups say they are a further black mark on Iraq's record of violations against LGBT people.
Those who promote homosexuality or prostitution, doctors who perform gender reassignment surgery, men who "intentionally" act like women and those who engage in "wife swapping" will also face prison terms under the new legislation.
A previous draft of the bill - an amendment to an anti-prostitution law that was passed in the late 1980s - had proposed capital punishment for same-sex relationships.
However, this was amended after facing opposition from the US and other Western countries.
MP Amir al-Maamouri told Shafaq News on Saturday that the new law was "a significant step in combating sexual deviancy given the infiltration of unique cases contradicting Islamic and societal values".
Passing the bill had been postponed until after Prime Minister Mohamed Shia al-Sudani's visit to the US earlier this month, according to lawmaker Raed al-Maliki, who advanced the amendments.
"We didn't want to impact the visit," Mr al-Maliki told the AFP news agency, adding that it was "an internal matter and we do not accept any interference in Iraqi affairs".
LGBT people have long been targeted by the authorities in Iraq, with other morality laws previously being used to punish them.
Human Rights Watch and other human rights organisations have also detailed several cases of abduction, torture, rape and murder.
Major Iraqi political parties have in recent years stepped up criticism of LGBT rights, with rainbow flags being burned at protests.
The US State Department said in a statement that the passing of the law reforms were a threat to human rights and freedoms.
"The legislation also weakens Iraq's ability to diversify its economy and attract foreign investment," it added.
"International business coalitions have already indicated that such discrimination in Iraq will harm business and economic growth in the country."
UK Secretary of State Lord David Cameron, meanwhile, described the amendments as "dangerous and worrying".
"No one should be targeted for who they are," he wrote on X, formerly Twitter.
"We encourage the Government of Iraq to uphold human rights and freedoms of all people without distinction."
Source: BBC