The Iraqi parliament on Saturday passed a bill making same-sex relations punishable by up to 15 years in prison.
Transgender people will also be sentenced to three years in jail under the amendments to a 1988 anti-prostitution law.
The legislation was adopted during a session attended by 170 out of 329 lawmakers.
A previous draft had proposed capital punishment for same-sex relations.
But the new amendments allow the courts to sentence people to between 10 and 15 years in prison.
They also set a minimum of a 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.
The amended law makes โbiological sex change based on personal desire and inclinationโ a crime and punishes trans people and doctors who perform gender reassignment surgery with up to three years in prison.