Ugandan President Yoweri Museveni has signed into law a controversial anti-homosexuality bill, despite criticism from Western countries.

The Ugandan anti-gay bill cruised through parliament in December after its architects agreed to drop an extremely controversial death penalty clause.

However, the bill still says that repeat homosexuals should be jailed for life, outlaws the promotion of homosexuality and requires people to denounce gays.

Homosexuality is illegal in 37 African countries.

Few Africans are openly gay, as they fear imprisonment, violence and loss of their jobs.

Mr Museveni signed the bill during a news conference at State House in Entebbe, close to the capital Kampala.

Ugandan government spokesman Ofwono Opondo earlier said: "He wants to sign it with the full witness of the international media to demonstrate Uganda's independence in the face of Western pressure and provocation."

The politician behind the bill, David Bahati, praised the decision to sign the bill.

"This is the moment the world has been waiting for," he told AFP.

"We thank our president for taking such a bold move despite pressure from a section of foreign organisations," Mr Bahati said.

"The law is for the good of Uganda, the current and the future generations."

Mr Museveni's decision to sign the bill comes less than a week since he announced plans to put the bill on hold to give scientists a chance to prove that homosexuality could be triggered by genes and is not a "lifestyle choice".

His announcement to delay the bill was seen as an attempt to appease its major aid donor, the US, coming only days after US President Barack Obama warned that the bill would complicate relations with Uganda.

Uganda is a key Western ally in the fight against Islamic extremism in Somalia, where Ugandan troops have formed the backbone of the African Union peacekeeping force battling al-Qaeda-aligned militants.

Mr Obama's comment that the anti-gay bill is a "step backward for all Ugandans" has been disputed by Ugandan officials who say the US is blackmailing the east African country, which gets about $400 million (€290m) annually in aid from the US.