Uganda has passed an anti-gay bill that imposes life sentences for some homosexual acts.

In a move described by opponents as "a truly terrifying day for human rights", MPs voted overwhelmingly in favour of the bill.

It has been widely condemned by activists and world leaders, with US President Barack Obama describing the bill as "odious" and Archbishop Nobel Peace laureate Desmond Tutu comparing it to apartheid.

The bill does not include the death penalty, as it did for "aggravated homosexual acts" when first tabled in 2009. Instead, those caught engaging in homosexual acts for a second time, as well as for gay sex where one partner is a minor or is infected with HIV, will face life in prison.

Ugandan media reported that a proposal for a reduced 14-year sentence was rejected by MPs, who instead upheld the penalty of life imprisonment.

David Bahati, the MP behind the private member's bill, hailed its adoption as a victory against "evil" in Uganda, a deeply religious country where many have embraced evangelical Christianity.

"Because we are a God-fearing nation, we value life in a holistic way," he said on Friday. "It is because of those values that members of parliament passed this bill regardless of what the outside world thinks."

The bill must receive final approval from Yoweri Museveni, the Ugandan President.

As in many African countries, gay men and women in Uganda face harassment, violence and death threats.

After the vote, Frank Mugisha, one of Uganda's most prominent gay activists, declared himself "officially illegal".

"This is a truly terrifying day for human rights in Uganda," he said. "It will open a new era of fear and persecution. If this law is signed by President Museveni, I'd be thrown in jail for life and in all likelihood killed. We urgently need world leaders to call on President Museveni and demand he stops this bill of hate from becoming law."

Mr Mugisha said there was "panic" among the country's gay and lesbian people.

"I'm outraged that members of parliament have passed this bill in a very uninformed way. It has been rushed. It has not been scrutinised," he said. "I am worried about my community."

Leslie Lefkow, of Human Rights Watch, said the law was "abhorrent".

"The bill's provision on the criminalisation of 'promotion' is a direct attack on the legitimate work of national and international activists and organisations working to defend and promote human rights in Uganda," the group added.

Homosexuality was already illegal in Uganda under a colonial-era law, but Mr Bahati argued that tougher penalties were needed to counter the influence of gay people from Western countries.

Rebecca Kadaga, the parliamentary speaker, promised last year that the bill would be passed as a "Christmas gift" to Ugandans.

On Thursday, Uganda passed an anti-pornography bill banning miniskirts and sexually suggestive television content including music videos.

The law reportedly outlaws anything that "shows sexual parts of a person such as breasts, thighs, buttocks", as well as "any erotic behaviour intended to cause sexual excitement or any indecent act or behaviour tending to corrupt morals".

Daily Telegraph, London