As a gay Ugandan, Frank Mugisha has endured insults from strangers, hate messages on his phone, police harassment and being outed in a tabloid as one of the country's "top homos". That may soon seem like the good old days.

Life imprisonment is the minimum punishment for anyone convicted of having gay sex, under an anti-homosexuality bill currently before Uganda's parliament. If the accused person is HIV positive or a serial offender, or a "person of authority" over the other partner, or if the "victim" is under 18, a conviction will result in the death penalty.

Members of the public are obliged to report any homosexual activity to police with 24 hours or risk up to three years in jail – a scenario that human rights campaigners say will result in a witchhunt. Ugandans breaking the new law abroad will be subject to extradition requests.

"The bill is haunting us," said Mugisha, 25, chairman of Sexual Minorities Uganda, a coalition of local lesbian, gay, bisexual, transgender and intersex groups that will all be banned under the law. "If this passes we will have to leave the country."

Human rights groups within and outside Uganda have condemned the proposed legislation, which is designed to strengthen colonial-era laws that already criminalise gay sex. The issue threatened to overshadow the Commonwealth heads of government meeting that ended in Trinidad and Tobago today, with the UK and Canada both expressing strong concerns. Ahead of the meeting Stephen Lewis, a former UN envoy on Aids in Africa, said the law "makes a mockery of Commonwealth principles" and has "a taste of fascism" about it.

But within Uganda deeply-rooted homophobia, aided by a US-linked evangelical campaign alleging that gay men are trying to "recruit" schoolchildren, and that homosexuality is a habit that can be "cured", has ensured widespread public support for the bill.

President Yoweri Museveni appeared to add his backing earlier this month, warning youths in Kampala that he had heard that "European homosexuals are recruiting in Africa", and saying gay relationships were against God's will.

"We used to say Mr and Mrs, but now it is Mr and Mr. What is that now?" he said. In a interview with the Guardian, James Nsaba Buturo, the minister of state for ethics and integrity, said the government was determined to pass the legislation, ideally before the end of 2009, even if meant withdrawing from international treaties and conventions such as the UN's Universal Declaration on Human Rights, and foregoing donor funding.

"We are talking about anal sex. Not even animals do that," Butoro said, adding that he was personally caring for six "former homosexuals" who had been traumatised by the experience. "We believe there are limits to human rights."

Homosexuality has always been a taboo subject in Uganda, and is considered by many to be an affront both to local culture and religion, which plays a strong role in family life. This stigma and the real threat of job loss means that no public personality has ever "come out".

Even local HIV campaigns – which have been heavily influenced by the evangelical church with a bias towards abstinence over condom use – have deliberately avoided targeting gay men for both prevention and access to treatment.

"This means many gay men here think Aids is a non-issue, which is so dangerous," said Mugisha, who together with a few colleagues, has risked arrest by agitating in recent years for a change in the HIV policy.

At the same time, some influential religious leaders have warned about the dangers of accepting liberal western attitudes towards homosexuality.

Both opponents and supporters agree that the impetus for the a more hardline law came in March during a seminar in Kampala to "expose the truth behind homosexuality and the homosexual agenda".

The main speakers were three US evangelists: Scott Lively, Don Schmierer and Caleb Lee Brundidge. Lively is a noted anti-gay activist and president of Defend the Family International, a conservative Christian association, while Schmierer is an author who works with "homosexual recovery groups". Brundidge is a "sexual reorientation coach" at the International Healing Foundation.

The seminar was organised by Stephen Langa, a Ugandan electrician turned pastor who runs the Family Life Network in Kampala and has been spreading the message that gays are targeting schoolchildren for "conversion". "They give money to children to recruit schoolmates – once you have two children, the whole school is gone," he said in an interview. Asked if there had been any court case to prove this was happening, he replied: "No, that's why this law is needed."

After the conference Langa arranged for a petition signed by thousands of concerned parents to be delivered to parliament in April. Within a few months the bill had been drawn up.

[In an email to the Guardian on 30 November, Scott Lively said, "I have stated publicly that I do not support the bill as written. It is far too harsh and punitive. My purpose in addressing members of the Uganda parliament in March was to urge them to emphasise therapy, not punishment in their anti-homosexuality law." His long-standing position was, he said, that public policy should "actively discourage homosexuality but only as aggressively as necessary to prevent its public advocacy, much the way laws against marijuana are used in various states here in the US: the law is very lightly enforced, if ever, but the fact the law is on the books prevents advocates of the drug from promoting it, for example, in public schools."]



Christopher Senyonjo, a retired Anglican bishop, said the bill would push Uganda towards being a police state. "This law is being influenced by some evangelicals abroad," he said. "There's a lack of understanding about homosexuality – it's not recruitment, it's orientation."

But among religious leaders of all faiths his is a rare voice. Langa, the pastor, said the only thing lacking in the legislation was a clause for "rehabilitation" of homosexuals, whom he "loves" and wants to help. Gay rights had the potential to destroy civilisation, as the west could soon find out, he said.

"As one parent told me: 'We would rather live in grass huts with our morality than in skyscrapers among homosexuals'."

• This article was updated on 1 December 2009 to add a later comment by Scott Lively. A sub-heading - US evangelists are main activists behind measure - was amended to clarify that the evangelists were pressing for tougher laws, rather than specifically for the death penalty.