Ugandan MPs on Friday passed an anti-gay law that sets life imprisonment as the maximum penalty for the new offence of “aggravated homosexuality”. The bill had included the death penalty when it was introduced in 2010, but that was removed from the revised version.

Homosexuality was already illegal in Uganda, under a colonial-era law that criminalised sexual acts “against the order of nature”, but the politician who wrote the new law argued that tough legislation was needed, because homosexuals from the West threatened to destroy Ugandan families and were allegedly “recruiting” Ugandan children into gay lifestyles.

Ugandan gays disputed this account, saying that political and religious leaders had come under the influence of American evangelicals who wanted to spread their anti-gay campaign in Africa.

Download the new Independent Premium app Sharing the full story, not just the headlines

Scott Lively, a Massachusetts evangelical, was sued in March 2012 under the Alien Tort Statute that allows non-citizens to file suit in the US if there is an alleged violation of international law.

Mr Lively denied he wanted severe punishment for gays, and has previously said he never advocated violence against gays, but advised therapy for them.

Homophobia is rampant in Uganda, but gays had come to believe progress was being made, and in 2012 the first gay pride parade was held; gays have also sometimes joined street marches in support of human rights.

Pepe Julian Onziema, a prominent Ugandan transgender and gay activist, declined to comment when contacted on Friday, saying he needed more time.

Despite criticism of the bill abroad, it was very popular among Ugandans, who said the country had the right to pass laws that protect its children.

The bill had been shelved repeatedly, despite protests, because of the international criticism. Late last year, Rebecca Kadaga, the speaker of Uganda’s parliament, threatened to pass the anti-gay law as a “Christmas gift” to all Ugandans.

When the bill was first proposed, US President Barack Obama called it “odious”.

AP