By North Asia correspondent James Oaten in Saipan for the ABC
Julian Assange is a free man after pleading guilty to one charge of espionage in a federal United States court as part of a plea deal with prosecutors.
But inside the room, he had one last act of defiance.
The tension was palpable as the chief judge entered the US federal court of the remote Northern Mariana Islands, deep in the Pacific Ocean.
After more than a decade of highly publicised legal battles and fierce debate over the publication of highly sensitive material, one of the biggest court cases of the year was to be resolved on a little-known US territory.
So little-known, the US federal judge felt compelled to address the matter in court.
"Not many people recognise we are part of the United States, but that is true," Chief Judge Ramona V Manglona said.
Assange was facing one charge of conspiracy to obtain and disclose national defence information, which carries a maximum 10-year jail penalty.
Julian Assange spoke directly and calmly when it was discussed if he was willing to enter a plea.
"Guilty," he said.
Eventually, the decision everyone expected was handed down.
Chief Judge Manglona said had Assange faced court in 2012, she would not be inclined to accept the deal.
But with the passage of time, she accepted there had been no physical injury as a result of his actions, and he had already served five years in one of the UK's harshest prisons.
She sentenced Assange to time already served in prison, meaning he is now a free man.
"I hope you start your new life in a positive manner," Chief Judge Manglona said.
After years of communicating through lawyers and advocates, there was a moment in the hearing when Assange spoke about his case in his own words.
He spoke calmly and confidently before the court, stating there were caveats to his guilt, and spoke of the US Constitution's First Amendment, which upholds free speech and freedom of the press.
It was another act of defiance against the US legal system that has pursued him for more than a decade.
"Working as a journalist, I encouraged my source to provide information that was said to be classified in order to publish that information," Assange told the court when asked to explain his understanding of the charge.
"I believed the First Amendment protected that activity.
"I believe the First Amendment and the Espionage Act are in contradiction."
Outside court, Australian human rights lawyer and Assange's longest-service counsel, Jennifer Robinson, said today was "a historic day".
"Julian Assange can go home a free man," she said.
"This also brings to an end a case which has been recognised as the greatest threat to the First Amendment in the 21st century.
"There has been a global movement behind Julian to protect free speech and it is because of the global movement of support that today's outcome is possible."
Robinson said: "This prosecution sets a dangerous precedent that should be of concern to journalists everywhere."
"The US is seeking to exercise extraterritorial jurisdiction over all of you without giving you constitutional free speech protections.
"Anyone who cares about free speech and democratic accountability should stand against it."
The US Department of Justice released a statement as proceedings concluded.
"Unlike news organisations that published redacted versions of some of the classified documents that Assange obtained from [Chelsea] Manning and then shared with those organisations, Assange and WikiLeaks disclosed many of the raw classified documents without removing any personally identifying information," the statement read.
"Specifically, in many instances, the classified documents [were released] … in a raw or unredacted form that placed individuals who had assisted the US government at great personal risk."
The department also confirmed it was part of the plea agreement that Assange would not be allowed to enter the United States without permission.
Assange was initially facing multiple charges of disclosing and publishing highly sensitive material, which could have seen the 52-year-old sentenced to up to 175 years in prison.
Under the terms of the plea deal, by admitting guilt to one charge, Assange is now a free man and can go home - a relief for him, his family, and his supporters.
And now a bilateral headache for the US and Australia is over.
Assange and WikiLeaks have long argued the disclosure of the highly sensitive material was public interest journalism, which is protected under the US Constitution.
His detractors argued that he recklessly dumped unfiltered material online, which put the lives of US personnel in jeopardy.
Even with his final act of defiance, Assange is now a convicted felon and has publicly admitted his work - at least part of it - overstepped the mark.
How this impacts journalism going forward is one of the many unknowns of this deal.
High commissioner, former PM by his side
Assange arrived at the courthouse in a white SUV wearing a black suit and a smile as he walked past security.
He entered the federal US court, a place he has made every attempt to avoid for 14 years, flanked by former Australian prime minister Kevin Rudd.
His expression was one of anticipation - positive and very much ready for the legal formalities to get underway.
He was supported by Australian High Commissioner to the UK Stephen Smith, who accompanied him on the journey out of Britain.
Robinson was also by his side. After years of representing Assange, both legally and as an advocate to politicians and the public, she too walked into court with an obvious look of cautious optimism and a hint of relief that a mammoth job was about to conclude.
Inside the courtroom, Assange stood as the chief judge entered and then the start of the end to his epic legal battle began.
While the hearing was underway, WikiLeaks announced Assange's flight out of the US territory would depart shortly after the court appearance ended and have him in Canberra by the end of the day.
The time on the ground in the Northern Mariana Islands was really just a detour on his way home, albeit the stop that would ultimately set him free.
- This story was first published by the ABC.