* New anti-gay law alarms homosexuals in Uganda
* Activists say human rights being eroded
* Foreign donors have taken dim view of legislation
Uganda's parliament passed a law on Friday that makes some homosexual acts punishable by life in prison, a spokeswoman for the legislature said, a move that raised alarm among gays who are already afraid to express their sexuality openly.
First introduced in parliament in 2009 as a private member's bill, the law initially proposed the death penalty for some homosexual acts in the conservative east African country.
It was later amended to remove the death penalty, but includes jail terms for anyone convicted, including life imprisonment for what it calls aggravated homosexuality.
Countries including the United States previously criticised the bill when it came before parliament. Germany cut off aid to Uganda late last year citing the bill as one of its concerns.
Widespread criticism of the law, and resistance from the executive which is wary of antagonising western donors, stalled its passage. But parliament has also been under pressure to push it through, especially from mainstream and evangelical churches.
Homosexuality was already illegal in Uganda, but the new law prohibits the "promotion" of gay rights and punishes anyone who "funds", "sponsors" or "abets" homosexuality.
Homosexuality is taboo in many African countries. It is illegal in 37 nations on the continent, and activists say few Africans are openly gay, fearing imprisonment, violence and losing their jobs.
Frank Mugisha, executive director of Sexual Minorities Uganda (SMUG), said he would try to rally rights activists to have the law blocked in the courts.
The president must sign any bill passed in parliament before it becomes law.
"We in the gay community are in a panic," Mugisha told Reuters. "People are afraid of walking in the streets, because they know how Ugandans like to take the law into their own hands."
International rights groups have criticized Uganda for passing a series of laws they say have chipped away at civil liberties and created an oppressive environment.
This week parliament passed an anti-pornography law that bans "erotic behaviour intended to cause sexual excitement and any indecent act or behaviour tending to corrupt morals."
Local media critics responded with derision, dubbing it the "anti-miniskirt" law because it proscribes wearing miniskirts.
In August, Uganda also passed a public order management law that requires anyone planning to hold a political rally or demonstration to give notice to the police.
The legislation gives authorities sweeping powers to stop such meetings if they have "reasonable grounds" to do so.