While homosexuality was already illegal in Uganda, the maximum penalty for the new offence of "aggravated homosexuality" is life imprisonment. The death penalty clause, originally included when the bill was introduced in 2010, was removed from the final version adopted by Uganda's parliament.
The bill had received international condemnation, including from U.S. President Barack Obama, who called it "odious", and Nobel Peace laureate archbishop Desmond Tutu, who compared it to apartheid.
Like India, the criminalization of homosexuality in Uganda stems from colonial-era laws.
Uganda LGBT activists, who have spoken out against the legislation, have argued that American evangelical Christians have influenced political and religious leaders in Africa with antigay campaigns.
Leading Ugandan gay rights activist David Kato was killed in his home in 2011.
Meanwhile, in other gay rights news, a U.S. federal judge struck down Utah's ban on same-sex marriage as unconstitutional on the same day. The Utah ruling came one day after New Mexico became the 17th U.S. state to legalize gay marriage.