Ugandan President Yoweri Museveni has signed a new law that carries harsh penalties for gay sex.
The president signed the "Anti-Homosexuality Bill" in Kampala Monday at a public event surrounded by government officials.
Museveni asserted that studies show homosexuality to be a choice, not a genetic trait. He also said groups are trying to recruit young Ugandans into a gay lifestyle.
The country's parliament passed the measure in December, with a 14-year sentence for first-time offenders and life in prison for those convicted of what the law terms "aggravated homosexuality."
U.S. President Barack Obama said earlier this month he was "deeply disappointed" with the law and that it will "reflect poorly" on Uganda's commitment to its citizens' human rights.
He said the United States has told Museveni that enacting the measure will complicate the relationship between the countries.
The original bill called for the death penalty in some cases, but that was dropped as Western nations and rights groups denounced the bill.
Homosexuality is illegal in 37 African nations and a taboo subject across many parts of the continent. Activists say few Africans are able to be openly gay.