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.