Uganda's parliament has passed a bill that would make some homosexual acts punishable by life in prison.
The bill was previously condemned by rights groups and Western governments, including the United States, in part because it included the death penalty.
The version passed Friday does not include the death penalty but calls for a life sentence for anyone convicted of what the bill calls "aggravated homosexuality."
An official with Human Rights Watch said the new bill is still appalling, despite some amendments. Amnesty International also criticized the measure, calling it "wildly discriminatory."
The legislation needs the signature of President Yoweri Museveni to become law.
One of the bill's sponsors, member of parliament David Bahati, said lawmakers showed courage in passing the legislation.
"I want to thank the speaker of parliament for the courage and defending the children of Uganda and the cause for humanity, to protect our marriages, to defend culture and to defend the future of our children. We have done our part, it is an important piece of legislation. We want to thank all those who have been supportive of us, we thank the religious leaders, we thank the parents and we thank all Ugandans who have been praying for us.''
Homosexuality is a taboo subject across many parts of Africa. Nearly 40 African nations criminalize homosexual activity and activists say few Africans are able to be openly gay.
The Ugandan parliament Thursday passed another controversial piece of legislation, an anti-pornography bill, which among other measures, bans the wearing of mini-skirts.