WikiLeaks founder Julian Assange has pleaded guilty to one count of espionage as part of a plea deal with US authorities.
His court appearance took place on the US territory of Saipan. He left the UK on Monday after being released on bail from Belmarsh high security jail.
Addressing the court, Assange said that he broke US law by encouraging classified leaks, but said he believed the Espionage Act violates free speech.
As per the deal, the judge sentenced Assange to time already served in a British prison and told him he would be able to leave court a free man.
The US request to extradite the WikiLeaks founder on spying charges has been dropped and he is now on his way to his home country of Australia to be reunited with his wife Stella and their two children, Gabriel and Max.
Mrs Assange posted on X after her husband walked out of court: “Julian walks out of Saipan federal court a free man. I can’t stop crying.”
WikiLeaks said Assange is expected to arrive in the Australian capital of Canberra at 6.41pm local time (9.41am GMT).
The 52-year-old arrived at court in a dark suit, with a loosened tie, after flying from Stansted Airport in London on a charter plane and stopping to refuel in Bangkok.
The flight cost him $500,000 (£394,000) with Mrs Assange calling for “emergency” donations to cover the “massive debt” for the jet.
She said her husband was “not permitted to fly commercial airlines or routes to Saipan and onward to Australia” and any contribution would be “much appreciated”.
Inside court, Assange answered basic questions from judge Ms Manglona and appeared to listen intently as terms of the deal were discussed.
As a condition of his plea, he will be required to destroy information that was provided to WikiLeaks.
Assange left court in a white SUV without speaking to reporters, but his lawyer Jennifer Robinson said it was because of support around the globe that “today’s outcome is possible”.
She said: “Julian has suffered for more than 14 years because of risk of extradition to the US… today he pleaded guilty to an offence for having published information in the public interest… this sets a dangerous precedent, this prosecution sets a dangerous precedent.”
Thanking Australian Prime Minister Anthony Albanese, Ms Robinson said he “did what he needed to do to ensure Julian’s freedom”.
Mr Albanese has publicly supported Assange as leader of the Australian Labour Party and as prime minister. He said in a statement earlier on Wednesday: “Regardless of what your views about Mr Assange’s activities, his case has dragged on for too long.
“There is nothing to be gained from his continued incarceration and we want him brought home to Australia.”
The hearing took place in Saipan – the US Commonwealth territory – because of Assange’s opposition to travelling to one of the 50 US states and the court’s proximity to Australia.
The US department of justice said following his sentencing, Assange will leave the US and will be “prohibited from returning” without permission.
American prosecutors had alleged Assange put lives at risk when he helped former US Army intelligence analyst Chelsea Manning steal diplomatic cables and military files WikiLeaks put online in 2010.
He had been locked in a legal battle in the UK over his extradition, which included him entering the Ecuadorean Embassy in London in 2012 prior to his detention in Belmarsh – where he had been since May 2019.