The bill drew wide condemnation when it was first introduced in 2010 and included the death penalty, but that was removed from the revised version passed by parliament.

Although a provision for the death penalty was removed from the original bill, the law passed Friday sets life imprisonment as the maximum penalty for the new offence of "aggravated homosexuality," according to the office of a spokeswoman for Uganda's parliament.

The bill was introduced to parliament by a lawmaker who argued the law was needed to deter Western homosexuals he accused of "recruiting" Ugandan children.

Homosexuality was already illegal in Uganda under a colonial-era law that criminalized sexual acts "against the order of nature," but the Ugandan lawmaker who wrote the new law argued that tough new legislation was needed because homosexuals from the West threatened to destroy Ugandan families and were allegedly "recruiting" Ugandan children into gay lifestyles.