WikiLeaks founder Julian Assange has pleaded guilty to one count of espionage as part of a plea deal with US authorities.
The agreement means Assange will be sentenced to time already served in a British prison.
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.
The US request to extradite the WikiLeaks founder on spying charges has been dropped and he is expected to fly to his home country of Australia shortly to be reunited with his wife Stella and their two children, Gabriel and Max.
WikiLeaks said Assange is expected to arrive in the Australian capital of Canberra at 6.41pm local time (9.41am GMT) if the plea is accepted by US District Judge Ramona Manglona.
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.
Read more:
Timeline of Assange’s 13-year legal battle
Plea deal marks end of a transatlantic tug of war
Artist’s threat to destroy masterpieces ‘helped free Assange’
As a condition of his plea, he will be required to destroy information that was provided to WikiLeaks.
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.
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.