Last month, the Ugandan President Yoweri Museveni finally signed his country’s controversial anti-gay bill into law, outlawing homosexuality and threatening offenders with up to 14 years in prison.

Mr Museveni claimed the measure was “provoked by arrogant and careless western groups that are fond of coming into our schools and recruiting young children into homosexuality.”

Critics of the legislation say it is not homosexuality that has been imported from the West, but homophobia. Roger Ross Williams, the director of God Loves Uganda, a documentary about the influence of conservative US Christians in the East African nation, said, “The anti-homosexuality bill would never have come about without the involvement of American fundamentalist evangelicals.”

Download the new Independent Premium app Sharing the full story, not just the headlines

One of the first to investigate links between American conservatives and the African anti-gay movement was Kipya Kaoma, a Zambian clergyman living in Boston. Homosexuality was illegal in Uganda under existing colonial laws, he explained, “But nobody was ever arrested or prosecuted based on those old laws. People turned a blind eye to it. Homosexuality was not a political issue.”

That changed in 2009, Rev Kaoma said, when a group of American evangelicals led by Pastor Scott Lively, a self-proclaimed expert on the “gay movement”, held a series of talks in Uganda. Mr Lively warned audiences that the “evil institution” of homosexuality sought to “prey upon” and recruit Ugandan children in a bid to “defeat the marriage-based society”.

Dr Frank Mugisha, director of the LGBT rights organisation, Sexual Minorities Uganda (Smug), recently told The Independent on Sunday, “[The idea] of a gay agenda, of recruiting people to homosexuality – that language wasn't used in Uganda pre-2009. [Lively] made my work very difficult and was conspiring with my legislators, but [to Ugandans] he was like God himself. People were worshipping him as if he was from heaven.”

American conservatives first arrived in Uganda in significant numbers following the fall, in 1979, of Idi Amin, the Muslim dictator who had banned evangelical Christianity. Among them was Mike Bickle, founder of the Kansas City-based International House of Prayer (IHOP). According to Mr Williams, “Bickle was there on the ground on the day Amin fell… with a group of American Christian leaders, to take the country as a Christian nation.”

US Christian groups have since spent millions on schools, hospitals and orphanages in Uganda. They have also found fertile ground for their religious values. Rev Kaoma said American conservatives may have lost the culture wars on the home-front, but they believe they can win in the developing world. “The battle has been fought on American soil, and then exported to the African continent,” he said.

Mr Williams’s film documents the involvement in Uganda of US pastors such as Lou Engle, a senior leader at IHOP, which has more than 1,000 staffers and a reported $30m (£18m) annual budget. Many of its young missionaries are at work in Uganda today. IHOP’s anti-gay agenda is explicit at home and abroad. In 2008, Mr Engle led a prayer rally of 33,000 people in San Diego, to pray for the passage of Proposition 8, California’s ban on same-sex marriage.

Before his influential trip to East Africa, Mr Lively was best known for his 1995 book, The Pink Swastika: Homosexuality in the Nazi Party, which asserted that Hitler and other leading Nazis were gay, and that their homosexuality inspired German militarism and the Holocaust. In March 2009, he spent five hours addressing the Ugandan parliament.

Daily coronavirus briefing No hype, just the advice and analysis you need Enter your email address Continue Continue Please enter an email address Email address is invalid Fill out this field Email address is invalid Email already exists. Log in to update your newsletter preferences Register with your social account or click here to log in I would like to receive morning headlines Monday - Friday plus breaking news alerts by email Update newsletter preferences

Rev Kaoma, who surreptitiously filmed one of Mr Lively’s seminars, said, “He brought to Uganda this new narrative of the so-called ‘international gay agenda’… You might think, ‘Is he out of his mind?’ But people believed him, [and] the narrative since 2009 has been about protecting children from homosexuals.”

That narrative proved compelling. Many Africans retain a lingering suspicion of the post-colonial West, while appeals to parental instincts are powerful in Uganda, the world’s most youthful nation: 50 per cent of its population is 15 years old or younger. For his part, Mr Lively told The Independent that the widely circulate video of his seminar “was selectively edited by a gay activist… It’s pure propaganda and not representative of my views.”

Shortly after Mr Lively’s visit, Ugandan MP David Bahati introduced the first draft of the Uganda Anti-Homosexuality Bill, which included the death penalty for “serial offenders”. Mr Bahati is a member of The Family, a secretive evangelical group based in Washington DC, whose ranks include current and former US lawmakers, and which also has a close relationship with President Museveni.

Mr Lively said that when he made recommendations to water down Mr Bahati’s draft, they were ignored. “I’m very glad they dropped the death penalty, which was beyond the pale,” he said. “I have mixed feelings about the remaining provisions… Simple homosexuality should not be punished with jail terms.”

In 2012 the US Centre for Constitutional Rights (CCR) sued Mr Lively on behalf of Dr Mugisha and Smug, alleging that his involvement in the passage of Uganda’s anti-gay legislation restricted the human rights of gay people. The case has yet to come to court. Mr Lively said, “I was invited to Uganda by Ugandans who were concerned by the transformations that were beginning to take place in their society… It’s a very racist premise to suggest that a white evangelical pastor, just by the force of his rhetoric, could overpower the will and intelligence of an entire African country.”

Yet following their success in Uganda, Mr Williams said, American fundamentalist evangelicals “are targeting the entire developing world… Country after country is passing these laws.” In January, Nigerian President Goodluck Jonathan signed his country’s anti-gay bill into law.

Mr Lively remains adamant that he had no influence on the wording of the Ugandan law. But he is content to take credit for similar developments elsewhere. In 2006 he called on Russia to “criminalise the public advocacy of homosexuality”. President Putin’s government introduced just such a law last year. Mr Lively said, “The Russian law that criminalises propaganda to children was, I believe, directly modelled on my suggestions.”

Case study: ‘I want to leave Uganda because I fear for my life’

Harold, 28

There is no one who says “I want to become gay”, especially here in Uganda. If you’re born with one hand missing I cannot force you to have a second because I want you to do boxing. We do not choose to be gay.

I’ve never told my parents I’m gay, only my older brother. Every time I think of sharing it with my mum I think she’ll get worried.

What I try to do is have friends that are girls and that makes my mum keep thinking that one of them might be a girlfriend.

Here if you are gay, people look at you as if you are a beast – you are abnormal. When I’m on public transport now, I get paranoid when people look at me. We feel worried all the time, that’s why I rarely [go out] on the street.

I had a professional job last year for six months but left it. Although they didn’t know that I’m gay, I never felt safe.

Up until this week I was mainly staying at home and only going out when I needed to buy something, but I had to start a supermarket job because I have to pay my rent. If you are renting a house and the landlord finds out you are gay, they will say “go away, you’re going to spoil my children”. There are also people who hunt gays – they have a belief that gay people have money.

Once they find out you are gay, they use their personal influence to make you suffer until they get something from you.

I don’t feel safe at all because of what happened to my friend, Albert; he was threatened a few weeks ago.

I’m sure they [the men who threatened him] know who I am, because they even came to my mother’s place looking for me. I want to leave [Uganda] because I fear for my life and have no peace.

The President wants to be re-elected and he’s ruled Uganda for so long that there are some groups who want him to leave. He was squeezed into a corner. If he refused to sign the [anti-gay] bill, citizens would not vote for him.

I don’t think things will ever change [for gay people in Uganda] because there was hatred for gay people even before the bill.

People are so attached to the culture and it’s all about preserving the culture. They know being gay is “bad”, and it’s harder to forget bad news than good news.

‘Harold’ is a false name. He told his story to Amy Fallon in Kampala