Kampala - With a World Bank scholarship and top grades in the first year of her masters degree in agriculture, 27-year-old Cleo Kambugu should be well on the road to her goal of an academic career in Uganda.

Instead, she's working out how to leave after the passing of a law that toughens prison sentences for homosexuality and a tabloid campaign to “out” gays.

“There is totally no hope right now,” said Kambugu, still legally a man despite a sex change in the last year that is not recognised by Uganda, a nation that now has some of the toughest anti-gay laws on a continent where 37 states ban homosexuality.

She worries about her safety on the streets after the newspaper Red Pepper slapped her picture on its front page under the headline “How we became homos”. The paper said such articles were in the public interest. Rights groups say it simply encourages people to take the law into their own hands.

The bill, signed into law by President Yoweri Museveni on February 24, has forced embattled gays deeper into the shadows, by threatening life in jail for “aggravated homosexuality” and a seven-year term for “aiding and abetting homosexuality”.

The United States has condemned the law and other donors have withheld aid. Some foreign investors are quietly reviewing plans. But it has broad backing from politicians and the public, while many popular churches preach against gay sex.

Fearing the worst, members of the gay community retreated. For weeks, Kambugu has stayed in her flat where she lives with her boyfriend. Her curtains are drawn and she rarely goes out.

“I can't even open my windows,” she said, her breast implants, red lipstick and long hair belying her legal gender. “I don't walk any more, I drive. I don't want to overstep the little security I have.”

Many gay Ugandans are now torn about what to do next: stay in Uganda and risk going to jail or seek asylum abroad.

Some have already chosen to go. Julian Onziema Pepe, spokesperson for Sexual Minorities Uganda (SMUG), said more than 20 gays had fled since the parliament first passed the bill on December. 20, sending it to the president for his signature.

Gays report being harassed - one was even beaten. Beyonce Karungi, a transgender activist, was punched and kicked by a mob in January. “We're going to chase you out of Kampala,” the men shouted, Karungi told Reuters when recounting the incident.

Passing the law has come at a cost for Uganda. The World Bank and donors - Sweden, Norway, Denmark and the Netherlands - have withheld aid or loans worth more than $118 million. Uganda's currency has tumbled on fears of further cuts to this vital source of hard currency. Investors are nervous.

The United States, a big donor, has called the legislation “atrocious” and compared it to anti-Semitic laws in Nazi Germany and apartheid in South Africa. It says it is reviewing ties.

But Museveni, a 69-year-old former rebel fighter, seems to have his gaze trained closer to home. Despite Western opprobrium, the popular law could help shore up support before a 2016 election. Though he has not said he wants to extend his 28-year rule, he is expected to run.

Only two MPs in the 260-seat parliament publicly criticised the bill.

“If you are a homo and you are destroying our society, you should be stopped,” said lawmaker David Bahati, author of the bill that had initially sought the death penalty for those considered the worst offenders when he introduced it in 2009.

Uganda officials have also brushed off Western criticism, saying threats to cut aid are tantamount to blackmail. Uganda will instead turn to China, Russia or India for loans or investment, as that support won't come with strings, they say.

Homosexuality has been banned in Uganda since independence in 1962 from colonial power Britain, which at that time also had laws under which gays could be prosecuted. But Museveni still procrastinated about toughening the law. As he delayed, officials assured Western allies that it would be buried.

An official at the US embassy in Kampala told Reuters that senior Ugandan officials repeatedly assured the US ambassador Scott DeLisi they would “manage” the bill but urged the US and other donors not to make a fuss so it could be quietly scrapped.

But when Museveni first suggested he planned to sign the law on February 14, it drew a swift response from US President Barack Obama, who declared any such move a “step backward” for Uganda. About a week after those comments, Museveni inked the law.

“There's now an attempt at social imperialism, to impose social values,” he said at the signing before foreign media. “We're sorry to see that you (the West) live the way you live, but we keep quiet about it.”

Gays had hoped for a different outcome during the years of haggling between parliament and president over the bill. Geoffrey Ogwaro, a gay activist, said Museveni had been his “hero” for stalling the bill since it first emerged in 2009.

“Suddenly he's my villain,” added Ogwaro, a 41-year-old man who was married and lived a double life for years because he feared the consequences of “coming out” in Uganda.

The chorus of anti-gay voices is not restricted to parliament. Influential pastors, who draw thousands to Sunday services, often openly denounce homosexual acts.

The huge stage at Kampala's Watoto church is one place where the message is delivered in spectacular style, with smoke machines, disco lights and the throbbing beat of a gospel choir.

On a Sunday in March, during one of five packed services held that day to fit in the crowds, Canadian pastor Gary Skinner told worshippers not to “sexually sin against their own bodies”.

The church has hosted Scott Lively, president of the Abiding Truth Ministries and prominent anti-gay campaigner. Gays say US evangelical churches have encouraged Uganda's anti-gay clerics.

Ssempa said he will launch mobile “rehabilitation” clinics for gays across Uganda, a nation with 34.5 million people.

Those with a different message can barely be heard. Former Church of Uganda Bishop Christopher Senyonjo, the country's only openly pro-gay clergyman, delivers his sermons in the cramped garage of a small house on the edge of the capital.

Kicked out of the church for pro-gay views and stripped of his pension after nearly half a century of service, Senyonjo said the law has silenced voices who support gays.

“We are gagged,” Senyonjo said inside his simple office. “I think people will not speak out unless they are ready to sacrifice themselves, and not many people will do that.”

It leaves gays struggling to find a way forward in Uganda.

Kambugu, who wants to complete her studies abroad after she said her sex change made it impossible to do so in Uganda, advocates a tactical retreat by activists until there is a change in the febrile mood on the street.

“We will be of no help dead. We will be of no help in prisons,” said Kambugu. “Right now we are in a place where people are frothing at the mouth and not listening to anyone.”

She said activists should take a gradual approach, trying to educate public opinion and make sure gays were given security.

Western states might also need to calibrate their approach. David Mpanga, a lawyer who represented a British producer deported from Uganda for staging a play about homosexuality, said it was no use for the West to condemn the anti-gay law vocally if it then stayed quiet on other rights abuses.

Despite opposition to the anti-gay law and concern about corruption, Western nations' criticism may be tempered because of Uganda's readiness to send troops into places like Somalia to fight Islamists, easing pressure on the West to act.

Rights activists, meanwhile, say they will contest the law in court, though that will not address the broader issue of entrenched public opinion that sees homosexuality as wrong.

“The law did not bring homophobia to Uganda,” said Kambugu. “The law will not make it disappear.” - Reuters