Ugandan President Yoweri Museveni has led a rally celebrating his country's new anti-gay laws, saying homosexuality creates grave health problems and that gays have always been regarded as abnormal by Africans.

Museveni made the comments on Monday at a "thanksgiving service'' organised in the capital Kampala by a coalition of Ugandan religious leaders and government officials who said the president deserves credit for defying Western pressures over the legislation.

Thousands attended the event, including schoolchildren who sang and danced to anti-gay tunes that also railed against the West.

Museveni, who in February signed a bill strengthening criminal penalties against homosexuals, said that he is "now mobilising to fight'' Western gays he accuses of promoting homosexuality in Africa.

Since enacting the law, Uganda has attracted sharp international criticism from rights groups and high-profile international figures who have denounced the legislation as draconian.

Aid halted

Western donors have halted or re-directed about $118m worth of aid after Museveni signed the law that toughened existing rules against gays and prescribed life in jail for what it called "aggravated homosexuality", such as sex with a minor.

Uganda still relies heavily on aid, including some direct support to the budget. But it has lived with aid disruptions before. In 2013, aid flows were cut over a corruption scandal. Growth slipped, but the economy still expanded about 6 percent.

"When you hear these Europeans saying they are going to cut aid ... we don't need aid in the first place," Museveni said at the rally. "A country like Uganda is one of the richest on earth."

Though Uganda currently has of some of the toughest codes, it is only one of 37 African nations to outlaw homosexuality.

The anti-gay bill was initially drawn up in 2009 by a local member of parliament, David Bahati, which proposed the death penalty for those offences deemed most serious, such as having gay sex when HIV-positive.

Museveni sent the bill back to parliament once and Western diplomats said they had received assurances from officials that the government would bury the law. When it passed, the United States called the law "atrocious" and said it would review ties.

The European Parliament responded to the law by backing sanctions against Uganda, saying the country had violated human rights and democratic principles.