An official says Uganda's president plans to sign into law an anti-gay bill passed by lawmakers that would allow life imprisonment for gays.

Ofwono Opondo, a government spokesman, said in Twitter posts Friday that President Yoweri Museveni told lawmakers that he would do that after receiving a report from "medical experts" saying "homosexuality is not genetic but a social behavior." Opondo did not say when the signing would happen.

Museveni previously had opposed the bill, saying it's too harsh. Homosexuality, which Museveni has called abnormal, is a crime in Uganda.

The bill, approved by parliament in December, would legalize life imprisonment for some homosexual acts.

Rights groups have called the bill draconian. Supporters, including Christian clerics, have said the law is needed to protect Ugandan children from Western homosexuals.