His release ends a 14-year legal saga in which Assange spent more than five years in a British high-security jail and seven years in asylum at the Ecuadorean embassy in London, battling extradition to the US, where he faced 18 criminal charges.
During the three-hour hearing, Assange pleaded guilty to one criminal count of conspiring to obtain and disclose classified national defence documents but said he had believed the US Constitution's First Amendment, which protects free speech, shielded his activities.
"Working as a journalist I encouraged my source to provide information that was said to be classified in order to publish that information," he told the court.
"I believed the First Amendment protected that activity but I accept that it was ... a violation of the espionage statute."
Chief US District Judge Ramona V. Manglona accepted his guilty plea and released him due to time already served in a British jail.
"We firmly believe that Mr. Assange never should have been charged under the Espionage Act and engaged in (an) exercise that journalists engage in every day," his US lawyer, Barry Pollack, told reporters outside the court.
WikiLeaks' work would continue, he said.
His U.K. and Australian lawyer, Jennifer Robinson, thanked the Australian government for its years of diplomacy in securing Assange's release.
Assange, 52, left the court through a throng of TV cameras and photographers without answering questions, then waved as he got into a white SUV.
He is set to leave Saipan on a private jet accompanied by Australia’s ambassadors to the US and UK, heading to the Australian capital Canberra, where they are expected to land around 7pm (local time), according to flight logs.
Assange had agreed to plead guilty to a single criminal count, according to filings in the US District Court for the Northern Mariana Islands.
The US territory in the western Pacific was chosen due to his opposition to travelling to the mainland US and for its proximity to Australia, prosecutors said.
Dozens of media from around the world attended the hearing, with more gathered outside the courtroom to cover the proceedings. Media were not allowed inside the courtroom to film the hearing.
"I watch this and think how overloaded his senses must be, walking through the press scrum after years of sensory depravation and the four walls of his high-security Belmarsh prison cell," Stella Assange, the wife of WikiLeaks founder said on social media platform X.
LONG SAGA
Australian-born Assange spent more than five years in a British high-security jail and seven holed up in the Ecuadorean embassy in London as he fought accusations of sex crimes in Sweden and battled extradition to the US, where he faced 18 criminal charges.
Assange's supporters view him as a victim because he exposed US wrongdoing and potential crimes, including in conflicts in Afghanistan and Iraq. Washington has said the release of the secret documents put lives in danger.
The Australian government has been advocating for his release and has raised the issue with the United States several times.
"This isn't something that has happened in the last 24 hours," Prime Minister Anthony Albanese told a news conference on Wednesday.
"This is something that has been considered, patient, worked through in a calibrated way, which is how Australia conducts ourselves."