LONDON — The Justice Department revealed Thursday that it has charged Julian Assange with computer hacking hours after the fugitive founder of WikiLeaks was arrested in London following a U.S. request to extradite him.

Assange, the publisher of state secrets that embarrassed governments around the world, was wanted in Britain for skipping bail in 2012, when he was under investigation in Sweden on charges of sexual assault and rape. He spent almost seven years living in the Ecuadorian Embassy in London to avoid extradition to the U.S.

Assange is charged with one count of "conspiracy to commit computer intrusion for agreeing to break a password to a classified U.S. government computer," according to the indictment released Thursday by the U.S. Attorney for the Eastern District of Virginia. If convicted, he faces up to five years in prison.

Prosecutors say the password was being sought by Chelsea Manning, a former Army intelligence officer who provided Assange with a trove of secret government documents that WikiLeaks published in 2010 — "one of the largest compromises of classified information in the history of the United States," according to the indictment.

Assange, 47, has said that the United States is trying to infringe on his journalistic freedoms. The indictment accused him of going beyond the role of a traditional journalist when he helped Manning crack the password that gave her access to hundreds of thousands of classified files.

Appearing at Westminster Magistrates' Court on Thursday afternoon, Assange pleaded not guilty but was convicted of failing to surrender to police on June 29, 2012. He will be sentenced in Crown Court, where more serious crimes are heard.

Assange faces extradition hearings on May 2 and June 12.

Addressing the media outside the court after the hearing, Assange's London-based attorney, Jennifer Robinson, said his arrest "sets a dangerous precedent for all media organizations and journalists."

"Since 2010 we’ve warned that Julian Assange would face extradition to the U.S. for his publishing activities with WikiLeaks," Robinson said. "Unfortunately today we’ve been proven right."

She added that she had just spoken to Assange, whose message to the world was: "I told you so."

Julian Assange arrives at a court in London on Thursday. Jack Taylor / Getty Images

In an interview with NBC News, Robinson said she was concerned about her client's health, adding that "he was in the middle of treatment for [a] root canal when he was arrested."

A source directly familiar with the situation told NBC News that the U.S. is making plans to seek Assange's extradition.

Footage shot by the Ruptly news video agency showed a bedraggled and bearded Assange being hauled out of the Ecuadorian Embassy by seven men. As he was bundled into a waiting police van, Assange shouted: "You must resist. You can resist. ... The U.K. must resist."

Ecuadorian President Lenin Moreno said in a video message that Assange had his diplomatic asylum withdrawn due to "repeatedly violating international conventions."

Ecuador decidió soberanamente retirar el asilo diplomático a Julian Assange por violar reiteradamente convenciones internacionales y protocolo de convivencia. #EcuadorSoberano pic.twitter.com/V02pvvtPY0 — Lenín Moreno (@Lenin) April 11, 2019

Moreno added that he asked the U.K. not to extradite Assange "to a country where he could face torture or the death penalty." In a subsequent statement, Ecuador's foreign minister said that the U.K. had given its assurance that it would comply with the request.

Alan Duncan, a British government minister, welcomed Assange's eviction and said it was the result of "extensive dialogue" between the U.K. and Ecuador.

Maria Zakharova, a spokeswoman for Russia's foreign ministry, criticized Assange's arrest. "The hand of 'democracy' squeezes the throat of freedom," she said in a Facebook post.

WikiLeaks said in a tweet that Assange's political asylum had been "illegally terminated in violation of international law."

URGENT



Julian Assange did not "walk out of the embassy". The Ecuadorian ambassador invited British police into the embassy and he was immediately arrested. — WikiLeaks (@wikileaks) April 11, 2019

The group has repeatedly claimed that the DOJ is building a criminal case centered on the leaking of Democratic emails hacked by the Russians in the 2016 election.

President Donald Trump's former lawyer, Michael Cohen, told a congressional hearing in February that former Trump campaign adviser Roger Stone was in contact with Assange before WikiLeaks released leaked emails from the Democratic National Committee.

Assange has always maintained that the source of the leaks was not Russia, contrary to the conclusion of U.S. intelligence agencies.

The White House referred questions about the Assange indictment to the DOJ. In an exchange with reporters in the Oval Office on Thursday, Trump appeared to downplay his knowledge of Assange's organization, saying: "I know nothing about WikiLeaks. It's not my thing."

Trump hasn’t always been circumspect when it comes to Assange and WikiLeaks. Less than a month before the 2016 election, he showered praise on the organization.

“I love WikiLeaks,” he said on Oct. 10.

Assange, who founded WikiLeaks in 2006, made international news in 2010 with the publication of the leaked information provided by Manning.

These included a video of a U.S. military helicopter fatally shooting people in Iraq, and thousands of classified military logs revealing sensitive information about the wars in Afghanistan and Iraq, thought to be the biggest leaks in U.S. military history.

Manning last month refused to testify before a federal grand jury looking into the release of documents to WikiLeaks.

In November 2010, the Swedish government issued an international arrest warrant for Assange in connection with allegations of sexual assault and rape from two women. Assange, who has denied the allegations, surrendered to British police the following month and was released on bail. He then fled, breaking the terms of his bond agreement.

Sweden dropped its investigation into Assange in 2017. But Sweden's chief prosecutor, Ingrid Isgren, said Thursday that the investigation into Assange could be reopened if he returned to the country before the statute of limitation expires in August 2020.

Elisabeth Massi Fritz, lawyer for one of Assange's accusers, said on Thursday that she would "do everything we possibly can" to get police to reopen the investigation "so that Assange can be extradited to Sweden and prosecuted for rape." The prosecutor's office said it had received a request from the original plaintiff to re-open the rape case.

Assange, a native of Australia, became an Ecuadorian citizen last year, even though his relations with his hosts had soured years ago.

In 2016, the Ecuadorian government cut off his access to the internet in the embassy after WikiLeaks published a trove of emails from Hillary Clinton's presidential campaign. The government said it was trying to make sure he couldn't interfere in the affairs of other countries.

Patrick Smith, Michele Neubert and Laura Saravia reported from London, Ken Dilanian from Washington, and Alex Johnson from Los Angeles.