An alleged British hacker has won an appeal to avoid extradition to the United States, a decision that a freedom of information group dubbed "a massive victory" for freedom of expression.

The UK High Court of Justice ruled on Monday that extraditing computer programmer Lauri Love to the US "would be oppressive by reason of his physical and mental condition".

Love was arrested in 2013 and faced three separate US extradition requests.

He was accused of hacking into and stealing data from several US government departments, including the US Federal Reserve, Department of Defense, NASA and the US Army.

His legal team said Love would face nearly 100 years in prison if he were extradited and charged in the US.

"This decision obviously affects my life but the reason I've gone through this ordeal is not just to save myself from being kidnapped and locked up for 99 years in a country I've never visited, but it's to set a precedent," Love told reporters outside the court after the decision was handed down.

Love suffers from depression and severe eczema and has Asperger's Syndrome.

His lawyers argued it would be "unjust and oppressive" to extradite him in light of his health condition, adding that he was a suicide risk.

"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," the High Court wrote in its ruling.

But Love could still be charged in the UK, the court said.

"We emphasise, however, that it would not be oppressive to prosecute Mr Love in England for the offences alleged against him," it wrote. "Much of Mr Love's argument was based on the contention that this is indeed where he should be prosecuted."

'Massive victory'

Love has been accused of taking part in #OpLastResort, a series of online protests organised in memory of Aaron Swartz.

Swartz, a US computer programmer and freedom of information activist, committed suicide in 2013 after the US charged him with wire fraud after a large trove of academic journal articles were illegally downloaded and shared online.

He was facing decades in US prison at the time of his death.

Human rights groups welcomed the UK court's decision on Monday.

"This ruling is a massive victory for free expression online," said Naomi Colvin, director of The Courage Foundation, an organisation that supports people persecuted in cases that involve issues of freedom of information.

"With any luck, today's ruling will mean that prosecuting authorities finally start respecting the clear will of the British public: we do not extradite our geeks to face medieval punishment in the United States," Colvin said in a statement.

Delighted @laurilove has WON his appeal against extradition to US! Where unlawful activity is alleged to have taken place in the UK, those suspected should be tried in the UK – not packed off to foreign courts. Shameful Lauri & his family were put through this ordeal #TrialAtHome — Liberty (@libertyhq) February 5, 2018

Liberty, a UK-based human rights group, also said it was "delighted" by the decision.

"Where unlawful activity is alleged to have taken place in the UK, those suspected should be tried in the UK," the group said on Twitter.