Simon Lokodo cannot imagine kissing a man. "I think I shall die," he said last week. "I would not exist. It is inhuman. I would be mad. Just imagine eating your faeces."

Lokodo is "ethics and integrity" minister in Uganda and a champion of the country's swingeing anti-homosexuality bill, which looked set to become law on Sunday until President Yoweri Museveni halted it, pending scientific advice. The delay was a small victory for activists dismayed a week ago when Museveni insisted that he would approve the legislation. That news prompted Kenneth Roth, executive director of Human Rights Watch, to tweet: "In name of Africa culture Uganda Pres will sign anti-gay law pushed by US evangelists toughening British colonial ban."

In 140 characters, Roth encapsulated a broad sweep of history and geography and one of the central paradoxes of Africa's new war on gay and lesbian people. It is a war marked by political opportunism, biblical fundamentalism and a clash between cultural relativism and universal human rights. But it is also a measure of conservatives' anxiety that every day more and more African homosexuals are coming out and losing their fear. Western liberals eager to see the best in Africa must face an inconvenient truth: this is the most homophobic continent on Earth. Same-sex relations are illegal in 36 of Africa's 55 countries, according to Amnesty International, and punishable by death in some states. Now a fresh crackdown is under way.

In January, Nigerian president Goodluck Jonathan signed into law a bill criminalising same-sex "amorous relationships" and membership of LGBT rights groups. Last week Gambian president Yahya Jammeh declared: "We will fight these vermins called homosexuals or gays the same way we are fighting malaria-causing mosquitoes, if not more aggressively."

This is not, however, merely the hate-filled bile of politicians. They make such statements because they know they will strike a popular chord in swaths of Africa. Anyone who has spent a fair amount of time on the continent is likely to encounter a warm, friendly, decent human being who will stop them short with an outburst of homophobic prejudice. Newspapers, TV and radio often fan the flames.

So it is in Uganda, where a tabloid once published photographs of dozens of gay people under the words: "Hang them." Homosexuality was already a crime there, but the new legislation, rushed through parliament in December, broadens the scope of life imprisonment for a range of "offences" including suggestive touching in public. Museveni has until Sunday to sign, veto or amend the bill, and at first he indicated that he would knock it back.

On 18 January, the Associated Press (AP) reported, he held a meeting with US-based rights activists and, on the phone, South African retired archbishop Desmond Tutu, who drew a comparison between the legislation and racist laws under apartheid. Museveni "specifically said this bill is a fascist bill," Santiago Canton of the Robert F Kennedy Centre for Justice and Human Rights told AP. "Those were the first words that came out of his mouth."

Something changed his mind. A month later the president, under domestic pressure, announced that he would sign the bill after receiving a report on homosexuality from a team of "medical experts". But the Observer has obtained the report, entitled "Scientific statement from the ministry of health on homosexuality"; it is far from the bigots' charter that might be expected. "Homosexuality existed in Africa way before the coming of the white man," it states. "There are a spectrum of sexual behaviours. Some people are less fixed in one form of sexuality than others. Thus sexuality is a far more flexible human quality than used to be assumed in the past. Homosexuality has no clear cut cause; several factors are involved which differ from individual to individual. It is not a disease that has a treatment."

But Simon Lokodo argues that the most important conclusion is that there is no definitive gene for homosexuality. "It is a social style of life that is acquired," he said by phone from Uganda. "They chose to be homosexual and are trying to recruit others. The commercialisation of homosexuality is unacceptable. If they were doing it in their own rooms we wouldn't mind, but when they go for children, that's not fair. They are beasts of the forest."

With chilling conviction, Lokodo, a former Catholic priest, set out why he believes the state should interfere in the choices of consenting adults in private. "Homosexuality is unnatural, abnormal and strange to our cultures," he said. "It has no output whatsoever; it only does damage and destruction. You cannot have a right to be a sick human being. There is no right in homosexuality. It must be cured."

The minister has also considered the anatomical implications. "Excretion is through the anus, like the exhaust of an engine. The human body receives what it takes from the mouth. They're twisting nature the wrong way. Homosexuality will destroy humanity because there is no procreation; it will destroy health because the backsides will not hold."

After the bill drew criticism from Barack Obama, Lokodo accused the west of trying to "blackmail" Uganda. "When I heard the US saying they will cut aid, we said fine. Will they be comfortable if we come to America and started practising polygamy? Homosexuality is strange to us and polygamy is strange to you. We have divergent views."

Promoters of the bill in Uganda, which gained independence from Britain in 1962, appealed to populist notions of culture that frame homosexuality as an "un-African", alien behaviour foisted on the continent by western imperialists. Seen through this prism, a strike against gay and lesbian people is a strike against colonialism and in favour of African nationalism and self-worth.

Yet as the scientists' report noted, homosexuality has existed throughout human history. Anthropologists found an ethnic group in central Africa where it was customary for a male warrior to marry a teenage boy and celebrate victory in battle by having sexual intercourse. In many cases, the very laws being imposed so zealously were introduced by the European empires that carved up and plundered Africa.

"Prior to western colonisation, there are no records of any African laws against homosexuality," said Peter Tatchell, the veteran human rights and gay rights campaigner. "The real import into Africa was not homosexuality but homophobia."

It was enforced legally by colonial administrators and ideologically by Christian missionaries. Tatchell, who twice tried to arrest Zimbabwean president Robert Mugabe over human rights abuses, added: "The colonial narratives of racism and homophobia are very closely intertwined. It's one of the great tragedies of Africa that so many people have internalised the homophobia of that colonial oppression and now proclaim it as their own authentic African tradition."

Defence of "tradition" can be a sleight of hand to trade on cultural relativism and exploit postcolonial guilt. Some in the west may be reluctant to criticise African attitudes, lest they be accused of racism. But activists counter that they are appealing to human rights, such as the right not to be tortured, that apply everywhere at all times. A minority has an absolute right to be protected from violations by a majority, they argue.

This counts for little at the altar of political expediency, however, according to Kapya Kaoma, an Episcopal priest from Zambia, and religion and sexuality researcher at the US-based thinktank Political Research Associates. Politicians tend to "blame the gays" to distract attention from their own failings, he says, casting them as the enemy within. Mugabe peppered his speeches with praise of Adam and Eve and denunciations of homosexuals as animals while electioneering last year.

The share of the sub-Saharan Africa population that is Christian climbed from 9% in 1910 to 63% in 2010, says the Pew Research Centre. Kaoma said: "Religious fundamentalism is strong in these countries. That provides the militant reaction to LGBT rights. One of the fears for fundamentalists is losing grip of the country; they are told they have lost grip because of the gays. They say, 'We don't want to lose Nigeria or Uganda just as our brothers lost America to the gays. If it means killing, we will kill.'" He said homosexuality is a rare point of convergence for Christian and Islamic hardliners.

US evangelicals have been accused of turning their attention to Africa and whipping up homophobia with lurid stories about child molestation, bestiality, rape and deadly diseases. Kaoma reflected: "In America the conservatives are losing. In Africa they are winning and the progressives are on the retreat. People are not paying attention to how world religions are taking advantage of globalisation. Those opposed to gay rights can connect very easily with African groups opposed to gay rights. In the past they had to travel; now they send an email and share tactics. Conservatives argue that gays are out to destroy 'traditional family values'; as Africans encounter fast-changing values, this language sounds very attractive."

There is, however, a paradox in the wave of oppression: the harsh laws being enacted may be a measure not of failure but of success, a reaction to gay and lesbians asserting their political identity and rights as never before. Graeme Reid, director of the lesbian, gay, bisexual and transgender rights programme at Human Rights Watch, said: "I do see it as a backlash against the increasing visibility. Over the last 25 years there's been an unprecedented growth of LGBT movements across sub-Saharan Africa. Clearly, this is an indigenous African phenomenon. There are various reasons: one is the HIV/Aids epidemic and the funding that became available for men who have sex with men. There was a more open discussion around sexuality."

Anyone who attended the recent opening of the Queer and Trans Art-iculations: Collaborative Art for Social Change, an exhibition at the Wits Art Museum in Johannesburg, could not help but feel hopeful. Many among the spectacular first-night crowd were confidently gay, lesbian, transgender and, in the word of one guest, "performative". Despite the works' reminder of the deadly hate crimes that persist in South Africa, the event's celebratory, out-and-proud atmosphere offered a glimpse of another possible future.

Last week, Edwin Cameron, a South African constitutional court judge, and one of the first public figures in Africa to come out as gay and HIV-positive, reflected: "The most interesting thing going on here is what I call an 'unstable transition'. It explains the force of the backlash just as African gays and lesbians are starting to come out. It releases hatred and rage, but what is happening is irreversible. Gays and lesbians are coming to consciousness, organising themselves and speaking out."