Uganda's President Yoweri Museveni has signed into law a bill toughening penalties for gay people but without a clause criminalizing those who do not report them.
It includes life sentences for gay sex and same-sex marriage, but a proposed sentence of up to 14 years for first-time offenders has been removed.
US President Barack Obama had cautioned the bill would be a backward step.
Mr Museveni had previously agreed to hold it pending US scientific advice.
Having spelled out its definition of homosexuality - which includes touching another person "with the intention of committing the act of homosexuality" - the act concludes that convicted offenders will be sentenced "to imprisonment for life"
The offence of "aggravated homosexuality" - which includes having sex with "a person living with HIV" or being "a serial offender" - will also lead to life imprisonment.
Homosexuality was already illegal in Uganda. However the new law makes it a criminal offence to conduct a marriage ceremony between persons of the same sex, or to promote homosexuality in any form. Individuals can be sentenced to seven years in jail. Organizations will be shut down.