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.
The US request to extradite Assange 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.
Assange 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.
Inside, he answered basic questions from US District Judge Ramona 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.
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 abrupt conclusion to the legal battle, which has lasted more than a decade, enables both sides to claim a degree of victory.