WikiLeaks founder Julian Assange has entered into a plea deal for his alleged role in a massive government data breach as part of an agreement with the Justice Department that will allow him to avoid imprisonment, according to court documents.

Assange will plead guilty to one count of conspiring to obtain and disclose information related to the national defense in a federal court in Saipan, in the Northern Mariana Islands, a U.S. territory, this week.

The guilty plea must be approved by a judge. Assange spent five years in a British prison fighting extradition to the United States. He previously spent seven years of refuge in the Ecuadorian Embassy in London after Swedish authorities sought his arrest on rape allegations.

AUSTRALIAN LAWMAKERS SEND LETTER URGING BIDEN TO DROP CASE AGAINST JULIAN ASSANGE ON WORLD PRESS FREEDOM DAY

julian assange

Wikileaks founder Julian Assange speaks on the balcony of the embassy of Ecuador in London, England, 19 May 2017. He called the decision of the Swedish judiciary an 'important victory'. Sweden surprisingly dropped the rape investigation against Assange. The Australian has been living in the chosen exile, the Ecuadorian embassy, for nearly five years, as he expects to be extradited. (Photo by Constantin Eckner/picture alliance via Getty Images)

Assange, 52, will be sentenced to time served of 62 months, the equivalent to the prison time he spent in the United Kingdom. 

On Monday, his wife, Stella Assange, celebrated the deal in a social media post.

"Julian is free!!!!" she wrote on X. "Words cannot express our immense gratitude to YOU- yes YOU, who have all mobilised (sic) for years and years to make this come true. THANK YOU. THANK YOU. THANK YOU."

Wikileaks said Assange was granted bail by the High Court in London and was released at London Stansted Airport where he boarded a plane to return to Australia.  

"As he returns to Australia, we thank all who stood by us, fought for us, and remained utterly committed in the fight for his freedom. Julian's freedom is our freedom," the group said in a social media post. 

A protester reads a newspaper outside the High Court in London

A protester reads a newspaper outside the High Court in London, Monday, May 20, 2024. (AP)

His asylum claim was eventually withdrawn by the Ecuadorian government, after they became irritated at his alleged behavior inside the embassy, and he was arrested in 2019. 

Free press advocates praised Assange's release online. Seth Stern, director of advocacy at Freedom of the Press Foundation, told Fox News Digital:

"It’s good news that the DOJ is putting an end to this embarrassing saga. But it’s alarming that the Biden administration felt the need to extract a guilty plea for the purported crime of obtaining and publishing government secrets. The plea deal won’t have the precedential effect of a court ruling, but it will still hang over the heads of national security reporters for years to come."

Julian Assange's wife speaks to a crowd

Stella Assange, the wife of WikiLeaks founder Julian Assange, delivers a speech in London, on May 17, 2022. Stella Assange posted a picture of the lawmakers' letter to X on Thursdays (Photo by JUSTIN TALLIS/AFP via Getty Images)

"The deal doesn’t add any more prison time or punishment for Assange. It’s purely symbolic," Stern added. "The administration could’ve easily just dropped the case but chose to instead legitimize the criminalization of routine journalistic conduct and encourage future administrations to follow suit."

Ben Wizner, director of the ACLU's Speech, Privacy, and Technology Project, told Fox News Digital said putting Assange on trial would have been a "worst-case scenario" for press freedom. 

"This is a prosecution that should not have been brought. Julian Assange has pled guilty to activities that are at the heart of national security investigative journalism, and that journalists perform every day," he said. "It's the job of journalists to pry out the government secrets and to reveal them in the public interest. Today, for the first time, that was described in a guilty plea as a criminal conspiracy. And we can only hope that the government is true to its word when it has insisted that the Assange case is distinguishable, that this will not set a precedent for targeting more mainstream news organizations."

The charges against Assange stem from one of the largest publications of classified information in American history. Assange, an Australian citizen and hero to many free press advocates, disclosed tens of thousands of documents related to reports about the U.S. wars in Iraq and Afghanistan, as well as State Department cables and information about the detention of prisoners at Guantanamo Bay.

A spokesperson for Australian Prime Minister Anthony Albanese told Fox News Digital he was aware of Assange's release. 

"We are aware Australian citizen Mr Julian Assange has legal proceedings scheduled in the United States. Given those proceedings are ongoing, it is not appropriate to provide further comment," he said. "The Australian Government continues to provide consular assistance to Mr Assange. Prime Minister Albanese has been clear - Mr Assange’s case has dragged on for too long and there is nothing to be gained by his continued incarceration."

Robert Kennedy Jr. said he was"overjoyed" by the news.

Stella Assange

Stella Assange, wife of Wikileaks founder Julian Assange, arrives at the Royal Courts of Justice in London, Monday, May 20, 2024. (AP)

"He's a generational hero," he posted on X. "The bad news is that he had to plea guilty to conspiracy to obtain and disclose national defense info. Which means the US security state succeeded in criminalizing journalism and extending their jurisdiction globally to non-citizens."

He further said the U.S. government should build a monument honoring Assange and called for the release of whistleblower Edward Snowden, who remains in Russia after fleeing the U.S., and Ross Ulbricht, the founder of the online drug-selling site Silk Road. 

U.S. Rep. Marjorie Taylor Greene, R-Ga., was pleased to hear that Assange was no longer being detained. 

"AMAZING NEWS! Julian Assange is set to be released after being held for years for the crime of committing journalism," she wrote on X. "Praise God for setting Julian FREE!!"

Rep. Thomas Massie, R-Ky., also reacted. 

":My plane landed in DC & I just heard Julian Assange will soon be free due to a deal," he wrote on social media. "His liberation is great news, but it’s a travesty that he’s already spent so much time in jail. Obama, Trump, & Biden should have never pursued this prosecution. Pardon Snowden & Free Ross now."

The plea agreement comes months after President Biden said he was considering a request from Australia to drop the U.S. push to prosecute Assange. The White House was not involved in the decision to resolve Assange's case, according to a White House official who not authorized to speak publicly and spoke to The Associated Press on condition of anonymity.

SUPPORTERS OF JULIAN ASSANGE RALLY AT JUSTICE DEPT. ON 4-YEAR ANNIVERSARY OF DETAINMENT

Federal prosecutors said Assange conspired with Chelsea Manning, then a U.S. Army intelligence analyst, to steal diplomatic cables and military files published in 2010 by WikiLeaks. Prosecutors had accused Assange of damaging national security by publishing documents that harmed the U.S. and its allies and aided its adversaries.

Manning was sentenced to 35 years in prison. President Barack Obama commuted the sentence in 2017 in the final days of his presidency.

Clayton Weimers, executive director of Reporters Without Borders (RSF) USA, said his group has been fighting to secure Assange's release.  

"In fact, our team, and in particular Director of Campaigns Rebecca Vincent, were the only NGO representatives present in the London courtroom for every single one of Assange's hearings and the only NGO to visit him in prison," Weimers told Fox News Digital. "His release represents a vindication of that yearslong fight. This is a victory for press freedom, but until the Espionage Act is reformed to include a public interest defense, this ordeal could happen to any publisher of leaked classified material, including journalists and media outlets."

Swedish prosecutors dropped their investigation into Assange in 2017 and an international arrest warrant against him was withdrawn. However, he was still wanted by British authorities for skipping bail when he entered the embassy. 

A protester holds a placard outside the Royal Courts of Justice in London

Julian Assange's lawyers are on their final U.K. legal challenge to stop the WikiLeaks founder from being sent to the United States to face spying charges. (AP)

CLICK HERE TO GET THE FOX NEWS APP

Assange made headlines again in 2016 after his website published Democratic emails that prosecutors say were stolen by Russian intelligence operatives. He was never charged in special counsel Robert Mueller’s Russia investigation.

The Associated Press contributed to this report.