Thousands of Ugandans led by President Yoweri Museveni held a rally Monday celebrating tough new anti-gay laws, praising the bill despite international criticism and donor aid cuts.
"Thank you for saving the future of Uganda," read signs held by the demonstrators, who marched through the streets of the capital Kampala.
Last month, Museveni signed a bill that calls for "repeat homosexuals" to be jailed for life and requires people to report homosexuals.
US Secretary of State John Kerry likened the new law to anti-Semitic legislation in Nazi Germany and warned it could damage ties with Washington.
Other demonstrators, who sang a song called "bye-bye homosexuality", appealed directly to US President Barack Obama.
"Obama, we want trade, not homosexuality," one sign read.
Critics have said Museveni signed the law to win domestic support ahead of presidential elections scheduled for 2016, which will be his 30th year in power.
But Museveni made clear his personal objection both to homosexuality -- which he claimed had "unhealthy repercussions" -- as well as to oral sex.
"Oral sex! The mouth is for eating, it's not for that purpose," he told the crowd.
Diplomats and rights groups had been hoping the president, who is already under fire from key Western donors over alleged rampant graft and for stifling opposition groups and media, would refuse to sign the legislation into law.
The European Parliament responded to the law by backing sanctions against Uganda, saying the country had violated human rights and democratic principles.
Annual foreign aid to Uganda accounts for a fifth of the east African country's $12-billion (8.6-billion-euro) annual budget.
But Museveni said Uganda would survive the cuts.
"Thanks for the support, but let us produce wealth so that we don't have to beg," he said.
"The Europeans are threatening us with aid because we are lazy, that is a weakness," he added.