A judge has ruled that a lesbian woman from Uganda may remain in the UK.

Prossy Kakooza, 26, fled her homeland after her family found her in bed with her partner and marched both women naked to the police station where Ms Kakooza was raped and tortured by police officers.

She escaped to the UK after her family bribed the guards to release her so they could have her killed. They believed this would ‘take away the curse from the family.’

The Home Office’s initial decision to deny Ms Kakooza asylum did not take into account the fact that she had been mistreated by the state and would probably face the same treatment again if she returned.

It believed that she was raped and tortured, because of the medical evidence, but dismissed her attack as the ‘random acts of individuals’ and suggested that she could move to another town in Uganda.

The Home Office will not appeal against the ruling that she can now remain in the UK, it emerged on Friday.

Ms Kakooza said that she is still in shock at the decision.

“You have held me together, you have held me upright when all I wanted to do was roll up in a heap and give up,” she said in an email to supporters.

“You gave me the motivation to go on and fight! Going with me to places to collect signatures, encouraging people to sign online, coming to meetings, writing statements, going to court with me, and most importantly – all the prayers.

“And I don’t think you have any idea how the phone calls, texts and emails help. They kept me sane.

“There are no appropriate words I can use to say thank you. All I can do is pray to my God to bless you all.

“You have changed my life and for that I will forever be grateful.”

More than 5,000 people from across the world had signed a petition to the Home Office to grant her asylum and hundreds more wrote to immigration ministers.

The MCC Manchester, a church that welcomes LGBT people, gave her financial and spiritual support.

Last month a gay man was removed from the UK and deported back to his native Uganda in what his supporters called an illegal act.

John “Bosco” Nyombi, 38, fears he will be persecuted on the grounds of his sexuality.

Homosexuality is illegal in Uganda, and gays caught by the police can face a life sentence in prison.

Mr Nyombi, who has been employed in the UK as a mental health worker since 2002, was taken to Heathrow Airport for deportation.

The Ugandan President spoke of his country’s “rejection” of homosexuality during a speech he gave at the wedding of a former MP’s daughter earlier this year.

Mr Museveni said the purpose of life was to create children and that homosexuality was a “negative foreign culture.”

During his time in office LGBT Ugandans have been repeatedly threatened, harassed or attacked. Many have fled the country.

The International Gay and Lesbian Human Rights Commission said:

“In the past five years, the government has arrested LGBT people on sodomy charges, harassed LGBT human rights defenders, and fined a private radio station that broadcast programming on HIV prevention and men who have sex with men.

“In July 2005, Uganda’s Parliament passed an amendment to the constitution making Uganda only the second country in the world to use its constitution to outlaw marriage between people of the same sex.

“A coalition of religious leaders has marched through the streets of Kampala demanding the arrests of LGBT people with one cleric even calling for the “starving to death” of homosexuals.

“Inspired by the official homophobia of the state, the Ugandan media has published lists of gay men and lesbians, leading to physical violence, loss of employment and educational opportunities by LGBT people.”

Last week Lin Homer, chief executive of the Borders and Immigration Agency (BIA), said that bans on homosexuality in asylum seekers’ home countries are not reason enough to allow them to stay in Britain.

“What the court takes into account is the practical consequences for the individuals concerned,” she told The Scotsman.

“The simple presence of either a law or a culture that frowns upon homosexuality is not of itself a reason [to grant asylum].

“I think these decisions are made carefully and thoughtfully.”

Ms Homer insisted that the information used by the BIA when deciding whether to deport gay asylum seekers is thorough and accurate.