KAMPALA, Uganda — Ugandan lawmakers on Friday passed a bill that calls for life imprisonment for certain homosexual acts, drawing criticism from gay rights advocates who called it ‘‘the worst in the world.’’
The legislation sets life imprisonment as the penalty for gay sex involving an HIV-infected person, acts with minors and the disabled, as well as repeated sex offenses among consenting adults, according to the office of a spokeswoman for Uganda’s parliament.
The bill also prescribes a seven-year jail term for a person who ‘‘conducts a marriage ceremony’’ for same-sex couples.
When the bill was first introduced in 2009, it was widely condemned for including the death penalty, but that was removed from the revised version passed by Parliament.
President Yoweri Museveni must sign the bill within 30 days for it to become law. Although in the past he spoke disparagingly of gays, in recent times Museveni has softened his position, saying he is only opposed to gays who appear to ‘‘promote’’ themselves.
‘‘In our society there were a few homosexuals,’’ Museveni said in March. ‘‘There was no persecution, no killings, and no marginalization of these people but they were regarded as deviants. Sex among Africans, including heterosexuals, is confidential. If I am to kiss my wife in public, I would lose an election in Uganda.’’
The passage of the bill makes it ‘‘a truly terrifying day for human rights in Uganda,’’ said Frank Mugisha, a prominent Ugandan gay activist, who called the legislation ‘‘the worst in the world.’’ He urged the country’s president not to sign it into law.
‘‘It will open a new era of fear and persecution,’’ he said. ‘‘If this law is signed by President Museveni, I’d be thrown in jail for life and in all likelihood killed.’’
The bill was denounced by rights groups in the United States.