Assange arrived at court in Saipan in a dark suit with a loosened tie. He is now expected to fly to his home country of Australia to be reunited with his wife Stella and their two children.
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.