SAIPAN - A US judge freed Julian Assange on Wednesday in a plea deal that ended years of legal drama for the WikiLeaks founder, long wanted by Washington for revealing military secrets.
"With this pronouncement, it appears that you will be able to walk out of this courtroom a free man," said the judge in a court in the Northern Mariana Islands, a Pacific US territory.
Assange had pleaded guilty to a single count of conspiracy to obtain and disseminate national defence information, AFP reporters inside the court said.
"Working as a journalist, I encouraged my source to provide material that was said to be classified," the 52-year-old, dressed in a black suit with a brown tie and his hair slicked back, told the court.
Assange, who from 2010 published hundreds of thousands of secret US documents as head of the whistleblowing website WikiLeaks, was released Monday from a high-security British prison.
The judge on Wednesday sentenced him to five years and two months in prison -- with credit for the same amount of time he spent behind bars in Britain while fighting extradition to the United States.
Looking tired but relaxed, Assange shared a brief laugh with Kevin Rudd, the Australian ambassador to the United States during a break in proceedings.
The Northern Mariana Islands was chosen because of Assange's unwillingness to go to the continental United States and because of its proximity to Australia, a court filing said.
After the hearing is done, Assange will fly to Canberra in Australia, WikiLeaks said on social media platform X, adding that the plea bargain "should never have had to happen."
Australian Prime Minister Anthony Albanese said the plea deal hearing was a "welcome development", after his government said Assange's case had "dragged on for too long" with "nothing to be gained by his continued incarceration".
The plea deal was not entirely unexpected. US President Joe Biden had been under growing pressure to drop the long-running case against Assange.
The Australian government made an official request to that effect in February and Biden said he would consider it, raising hopes among Assange supporters that his ordeal might end.