Homosexuality is illegal in several African countries
UN Secretary General Ban Ki-moon, in an unusually outspoken declaration on Sunday, told African leaders they must respect gay rights, an issue that is controversial in many African states.
"One form of discrimination ignored or even sanctioned by many states for too long has been discrimination based on sexual orientation or gender identity," Ban said at an African Union summit in the Ethiopian capital.
"It prompted governments to treat people as second-class citizens or even criminals," he added.
Homosexuality is outlawed in most African countries and discrimination against gays and lesbians is rife on the continent, with South Africa being the only country that recognises gay rights and same-sex marriage, at least on paper.
However, previous external criticism of restrictions imposed on homosexuals has attracted angry responses from African leaders, who claim it is alien to their culture.
Outgoing African Union chairman Tedoro Obiang Nguema, speaking before Ban's remarks were delivered, complained about the external criticism the continent receives.
"Africa should not be questioned with regards to democracy, human rights, governance and transparency in public administration," he told the summit.
After Commonwealth leaders refused to adopt reforms to abolish homophobic laws in 41 member nations, British Prime Minister David Cameron said last year he would consider withholding aid from countries that do not recognise gay rights.
"Confronting these discriminations is a challenge, but we must not give up on the ideas of the universal declaration" of human rights, Ban told the summit.
Gay rights in Africa, most notably in Uganda, made the news on several occasions last year.
Homosexuality is already illegal in Uganda, but a controversial bill that calls for the death penalty for certain homosexual acts was re-introduced in the Ugandan parliament late last year.
The proposed legislation envisages stiffer punishments -- including the death penalty -- for anyone caught engaging in homosexual acts for the second time as well as for gay sex where one partner is a minor or has HIV.
Gay rights activists have blamed an increase in homophobia in Uganda on evangelical preachers, some of whom are close to the regime of President Yoweri Museveni.
Sexual Minorities Uganda (SMUG), a group of gay activists based in Kampala, welcomed Ban's remarks.
"It holds a lot of weight that Ban Ki-moon has come to this meeting and addressed this issue," SMUG advocacy officer Pepe Julian Onziema told AFP by telephone.
"It makes a difference because it is an issue that the African Union has ignored. We have pushed them on it but they have shut us out," he added.
The Ugandan government, however, said that while it did not condone discrimination, it remained firmly opposed to homosexuality and continued to view the practice as a crime.
"For as long as they are human beings we respect them but in terms of their practice and orientation we strongly condemn it," Ethics and Integrity minister Simon Lokodo told AFP.
While he said he was unaware of the specifics of Ban's statement, Lokodo said the Ugandan government strongly rejects any moves it thinks would spread homosexuality.
"We condemn in all strongest forms anyone who promotes or propagates these practices."
Ban also told leaders that they should respect democracy, noting that the Arab Spring revolutions that swept north Africa last year were "a reminder that leaders must listen to their people."
"Events proved that repression is a dead end. Police power is no match to people power seeking dignity and justice," he said.