Ugandan President Yoweri Museveni said Friday that he plans to sign a bill into law that prescribes life imprisonment for what lawmakers term as “aggravated” homosexual acts. (Carl Court/AP)

President Obama on Sunday sharply criticized Uganda’s government for its plans to enact legislation that would apply proscribe strict prison sentences for homosexual acts, as the United States takes a leading role in pressuring other governments to respect the rights of gay citizens.

“I am so deeply disappointed that Uganda will shortly enact legislation that would criminalize homosexuality,” Obama said in a statement. “The Anti-Homosexuality Bill in Uganda, once law, will be more than an affront and a danger to the gay community in Uganda.”

Ugandan President Yoweri Museveni said Friday that he would sign the legislation, which imposes a 14-year prison sentence on people convicted of an initial homosexual act and the possibility of life in prison if convicted of further homosexual relations.

Homosexuality is illegal in 38 of 54 African countries.

Obama said the legislation “will be a step backward for all Ugandans and reflect poorly on Uganda’s commitment to protecting the human rights of its people. It also will mark a serious setback for all those around the world who share a commitment to freedom, justice and equal rights.”

National security adviser Susan E. Rice “spoke at length” with Museveni on Saturday night, telling him that signing the legislation would be a “huge step backward for Uganda and the world,” she wrote on Twitter on Sunday morning.

In his statement, Obama reported a worrisome rise in “reports of violence and harassment targeting members of the LGBT community from Russia to Nigeria.”

At the same time, he said, “I salute all those in Uganda and around the world who remain committed to respecting the human rights and fundamental human dignity of all persons.”