KAMPALA Uganda—Uganda's President Yoweri Museveni is set to sign the antigay bill into law, in an abrupt policy shift just a few weeks after the country's long serving leader appealed for more time to study the bill.

If enacted, the bill could lead to a life sentence for persons convicted of homosexual acts.

Mr. Museveni's decision came after medical experts presented a report asserting that homosexuality isn't "genetic but a social behavior" to lawmakers from the ruling National Resistance Movement party.

The decision comes amid similar efforts in Africa to legislate against homosexuality, which is considered a taboo in many societies on the continent.

In January, Nigerian President Goodluck Jonathan signed into law a bill that makes homosexuality a criminal offense, drawing condemnation from human-rights activists.

"President Museveni declared that he would sign the bill…[he] emphasized that homosexual promoters, exhibitionists and those who practice homosexuality for mercenary reasons will not be tolerated" said Anite Evelyn, spokeswoman for the ruling NRM party.

The ruling party dominating parliament passed the bill in December, but Mr. Museveni has to sign it for it to become law. After delaying its signing, Mr. Museveni appointed a panel comprised of medical experts from the health ministry and the country's oldest public university, Makerere University, to study homosexuality and genetics in human beings.

The panel said in the report presented at a conference of the ruling party lawmakers, that there is "no definitive gene responsible for homosexuality."

"Homosexuality is not a disease but merely an abnormal behavior which may be learned through experiences in life" the panel said.

David Bahati, a Ugandan lawmaker, first introduced the bill in 2009, sparking world-wide condemnation for tough measures that included the death penalty. The bill has since undergone a number of amendments, but activists insist it remains the "worst" in the world.

"The international community has a legal and moral obligation to prevent this law from being implemented," U.S.-based rights group, Center for Constitutional Rights said Saturday. "This dangerous legislation had already intensified the climate of hatred and persecution… in Uganda."

During the same conference, lawmakers passed a resolution urging Mr. Museveni to run for re-election in 2016, as the party's flag bearer. In power since 1986, Mr., Museveni is already one of Africa's longest serving leaders. Initially credited for stabilizing the hitherto crisis-stricken nation, Mr. Museveni has been facing mounting criticisms over human rights abuses and attempting to rule for life.

Write to Nicholas Bariyo at nicholas.bariyo@wsj.com