Alleged computer hacker Lauri Love has won his High Court appeal against his extradition to the US.
Mr Love, 33, from Stradishall, Suffolk, was first arrested in October 2013 on suspicion of hacking into FBI, US Central Bank and Nasa systems.
US officials demanded he be tried there but Mr Love, who has Asperger syndrome, said he feared dying in jail there.
Appeal judges said it would "not be oppressive" to "prosecute Mr Love in England for the offences".
In their conclusion Lord Chief Justice Lord Burnett and Mr Justice Ouseley said Mr Love, who also has depression, "did not seek impunity for the acts alleged against him, but contended that he should be tried and, if convicted, sentenced in the United Kingdom".
They said: "We have come to the conclusion that Mr Love's extradition would be oppressive by reason of his physical and mental condition."
The judges added: "We accept that the evidence shows that the fact of extradition would bring on severe depression, and that Mr Love would probably be determined to commit suicide, here or in America."
Lauri Love case timeline
28 October 2013: Lauri Love is arrested in Suffolk under the Computer Misuse Act and accused of breaching the security of Nasa and FBI, among other US government agencies. He is released on bail.
27 February 2014: Mr Love is accused of a new charge of hacking into US Federal Reserve computer servers and stealing the personal information of users.
20 February 2015: Police in the UK say they will not return Mr Love's computer because they cannot decrypt its files.
16 July 2015: Mr Love is re-arrested by the Met Police executing an extradition warrant on behalf of the US.
20 August 2015: Mr Love tells the BBC he fears he will not get a fair trial in the US.
10 May 2016: A bid by the National Crime Agency to force Mr Love to hand over encrypted computer passwords is thrown out by a district judge at Westminster Magistrates' Court.
6 September 2016: Mr Love tells the BBC he fears dying in jail if he is extradited.
16 September 2016: A judge at Westminster Magistrates' Court rules Mr Love should be extradited to the US.
24 October 2016: MPs sign a letter asking President Obama to block Mr Love's extradition.
14 November 2016: Home Secretary Amber Rudd signs the extradition order.
29 November 2017: The Court of Appeal begins hearing Mr Love's appeal against extradition.
Mr Love is alleged to have stolen huge amounts of data from US agencies, including the Federal Reserve, the US army, the defence department, Nasa and the FBI in a spate of online attacks in 2012 and 2013.
However, his supporters had warned if he was extradited there was a "high risk" he would kill himself.
Mr Love, speaking outside the court, said he hoped he had set a "precedent so this will not happen to people in the future".
"I'm hoping that this outcome can contribute to the discussion we are having as a society about how to accommodate people that have neuro-diversity, whose brains are made up in a slightly different way," he said.
"There is an ongoing problem with people with autism in the justice system – they have actually been debating it in Westminster Hall.
"I hope in the future to be able to contribute to a slightly better understanding of the stigma associated with depression."
His father Alexander Love said: "This is a victory for justice. What makes Great Britain great is that we live in a place with wisdom and compassion."
Authorities in the US have been fighting for Mr Love to face trial on charges of cyber-hacking, which lawyers have said could have meant a sentence of up to 99 years in prison if he was found guilty.
The decision to block extradition was met with cheers in the packed London courtroom.
A spokesman for Mr Love's solicitors, Kaim Todner, said it was "important" the British justice system "has taken the stance that we should deal with the matter ourselves, rather than accept the US government's demands".
"It has also been recognised that mental health provisions in US prisons are not adequate to satisfy us that Lauri would not have come to serious harm if he were extradited," the statement added.
Emma Norton, head of legal casework for campaign group Liberty, said she was "delighted" the court had "recognised Lauri's vulnerability, close family connections to the UK and the potentially catastrophic consequences of extraditing him".
She added: "This was always a case that could have been prosecuted here and it's shameful that Lauri and his family have been put through this terrible ordeal."