A Ugandan woman who says she is a lesbian has been granted an injunction temporarily preventing her deportation.
Brenda Namiggade says she fears for her life if she is returned from the UK to Uganda, where gay sex is illegal.
Her initial asylum application had been refused. The Home Office said a court had ruled she was "not homosexual" and therefore did not have a genuine claim.
Prominent gay rights campaigner David Kato was beaten to death near the Ugandan capital Kampala on Wednesday.
Ms Namiggade's case will now go to judicial review.
Ms Namiggade's legal team asked a judge to grant an injunction against her deportation, which was due to take place on Friday evening.
The 29-year-old's lawyer told the BBC his client had already boarded her flight at Heathrow airport when the injunction was granted.
Her lawyer, Abdulrahman Jafar, said he would argue that Ms Namiggade should be allowed to remain in the UK regardless of her sexuality.
"The press coverage about her activities certainly expose her to a real risk if she is to be returned to Uganda," he said.
Ms Namiggade, who was held at a detention centre just outside London, has told the BBC's Network Africa programme she was "shaking" with fear at the prospect of returning to Uganda.
She said she fled to the UK in 2002 after being beaten and victimised because of her sexuality.
Homosexual acts are illegal in Uganda, with punishments of 14 years in prison. An MP recently tried to increase the penalties to include the death sentence in some cases.
Shadow home secretary Yvette Cooper said the UK Border Agency's guidance for Uganda was nearly two years old and should be updated "as fast as possible" to reflect the situation on the ground.
She said: "LGBT [lesbian, gay, bisexual, and transgender] people in Uganda have faced arbitrary arrests, unlawful detention and ill treatment, and the new plans for even more homophobic laws are deeply worrying."
The United Nations High Commissioner for Refugees, Antonio Guterres, has said people facing persecution for their sexual orientation in Uganda should be given refugee status in other countries.
Human rights campaigner Peter Tatchell has urged Home Secretary Theresa May to halt the removal of Ms Namiggade and allow her to make a fresh asylum appeal.
A UK Border Agency spokesman said: "Ms Namiggade's case has been carefully considered by both the UK Border Agency and the courts on three separate occasions and she has been found not to have a right to remain here.
"An immigration judge found on the evidence before them that Ms Namiggade was not homosexual."
The government was committed to stopping the removal of asylum seekers who had left their countries because of their sexual orientation, the spokesman added.
"However, when someone is found not to have a genuine claim we expect them to leave voluntarily."
Mr Kato had sued a local newspaper which outed him as homosexual.
Uganda's Rolling Stone newspaper published the photographs of several people it said were gay, including Mr Kato, with the headline "Hang them".
It is unclear whether the killing of Mr Kato was linked to his campaigns.