(CNN) -- Ugandan President Yoweri Museveni has signed into law a bill that toughens penalties against gay people and defines some homosexual acts as crimes punishable by life in prison.
Homosexual acts are already illegal in Uganda, and Museveni had gone back and forth recently about whether he would sign the controversial bill in the face of vocal opposition from the West.
At the public signing of the bill Monday, a defiant Museveni declared that he would not allow the West to impose its values on Uganda.
"We have been disappointed for a long time by the conduct of the West, the way you conduct yourselves there," he told CNN's Zain Verjee in Entebbe. "Our disappointment is now exacerbated because we are sorry to see that you live the way you live, but we keep quiet about it. Now you say 'you must also live like us' -- that's where we say no."
The bill, introduced first in 2009, originally included a death penalty clause for some homosexual acts. It was briefly shelved when Britain and other European nations threatened to withdraw aid to Uganda, which relies on millions of dollars from the international community.
The nation's parliament passed the bill in December, replacing the death penalty provision with a proposal of life in prison for "aggravated homosexuality." This includes acts in which one person is infected with HIV, "serial offenders" and sex with minors, according to Amnesty International.
The bill also proposed years in prison for anyone who counsels or reaches out to gays and lesbians, a provision that would ensnare rights groups and others providing services to lesbian, gay, bisexual and transgender people.
Museveni's position on the law changed several times since lawmakers passed it late last year. In January he said he wouldn't sign the bill, describing homosexuals as "sick" people who needed help, not imprisonment. But he backtracked this month and said he'd sign it because scientists had determined that there is no gene for homosexuality and that it is merely a choice to embrace abnormal behavior.
"It was learned and could be unlearned," Museveni said.
Shortly after his announcement, U.S. President Barack Obama warned that enacting the bill would affect relations between the two nations. He described the proposal as an "affront and a danger to the gay community" in Uganda. The U.S. is among the nation's largest donors.
On Monday, Museveni rejected the suggestion that the new laws were a step back for Uganda and said he wasn't concerned about the West's perception of his country.
"Worried? Not at all," he told CNN. "If the West doesn't want to work with us because of homosexuals, then we have enough space here to live by ourselves and do business with other people."
"We see how you do things, the families, how they're organized. All the things, we see them, we keep quiet," he said. "It's not our country, maybe you like it. So there's now an attempt at social imperialism -- to impose social values of one group on our society."
Homosexuality in Africa
Homosexuality is illegal in 38 African countries, where most sodomy laws were introduced during colonialism. In Uganda, homosexual acts were punishable by 14 years to life in prison even before the controversial bill was signed into law.
Lawmakers in the conservative nation sought tougher legislation, saying the influence of Western lifestyles risked destroying family units.
Rights groups worldwide have condemned the bill as draconian.
CNN's Zain Verjee and Antonia Mortensen in Entebbe, Uganda, and Yousuf Basil in Atlanta contributed to this report, which was written by Faith Karimi in Atlanta and Nick Thompson in London.