The US has voiced concern over an anti-homosexuality bill passed by Uganda's parliament.

"We are deeply concerned by the Ugandan Parliament's passage of anti-homosexuality legislation," State Department spokesperson Jen Psaki said on Tuesday.

"As Americans, we believe that people everywhere deserve to live in freedom and equality - and that no-one should face violence or discrimination for who they are or whom they love."

The Ugandan bill would make homosexuality punishable by up to life in prison if it is eventually signed into law.

It passed through Uganda's parliament last week after a death penalty clause was dropped.

British tycoon Richard Branson also spoke out against the bill, and urged companies to boycott Uganda earlier on Monday.

Bill approval

The Virgin founder said Uganda must abandon the bill or find itself "ostracised by companies and tourists worldwide".

"I have been courted by various people and government officials to do business in Uganda. I was seriously considering it," Branson wrote on his website on Monday.

"However, the dreadful witch hunt against the gay community and lifetime sentences means it would be against my conscience to support this country."

Activists fear Ugandan President Yoweri Museveni, an evangelical Christian,  is likely to approve the bill, which has widespread support in a country where homophobia is rampant.

Gay Ugandans face frequent harassment and threats of violence, and rights activists have also reported cases of lesbians being subjected to "corrective" rapes.

Anti-gay moves by Ugandan politicians have been widely condemned, with US President Barack Obama describing the bill before it was passed as "odious" and South African Nobel Peace laureate Desmond Tutu comparing it to apartheid.

Uganda is a long-time ally of the US with close military ties, although former Secretary of State Hillary Clinton criticised officials in 2012 during a trip to Kampala when an even more repressive anti-gay bill was being

Source: Agencies