LONDON – WikiLeaks founder Julian Assange was sentenced to 50 weeks in jail for skipping bail in Britain seven years ago and seeking refuge in the Ecuadorian Embassy.

Deborah Taylor, the judge at London’s Southwark Crown Court, said Assange’s time in the embassy cost British taxpayers about $21 million and she imposed a near-maximum sentence because of his "deliberate attempt to delay justice."

The sentencing comes one day before a court hearing in London over a U.S. extradition request for Assange. The Department of Justice charged him with conspiring to break into a Pentagon computer system to reveal government secrets.

The Justice Department alleges that Assange, a computer hacker, assisted Chelsea Manning, then a soldier in the U.S. Army, in cracking a password stored on U.S. Department of Defense computers. WikiLeaks subsequently published thousands of classified U.S. military and diplomatic cables and images, including video footage purportedly showing U.S. soldiers killing civilians in Iraq.

Manning served nearly seven years of a 35-year sentence for theft and espionage for helping to deliver classified documents to WikiLeaks. The sentence was commuted by President Barack Obama, and Manning was released in 2017.

Want news from USA TODAY on WhatsApp? Click this link on your mobile device to get started

Though extradition cases can take years before a decision is reached, Wednesday's sentencing probably means it will be close to a year before U.S. prosecutors have any chance of getting their hands on Assange.

Journalist or criminal?:Julian Assange was notorious for leaks of US secrets

Assange was arrested last month inside the Embassy of Ecuador after the South American country revoked his political asylum. The 47-year-old Australian sought asylum in the embassy in June 2012 to avoid extradition to Sweden, where he was wanted for questioning over rape and sexual assault allegations.

Assange's legal team expected that if he was extradited to Sweden, he would subsequently be extradited from the Scandinavian nation to the USA.

The rape and sexual assault charges against Assange were dropped because his residence in the Ecuadorian Embassy stymied the investigation and the statute of limitations expired. Swedish prosecutors indicated they are considering a request from one of Assange's alleged victims to reopen the rape investigation.

If that happens, Assange could face a competing claim for extradition.

As he arrived at Southwark Crown Court in a prison van Wednesday, Assange raised a clenched fist.

Like what you’re reading?:Download the USA TODAY app for more

What Barr plans to tell Congress:Read his opening statement

Mueller-Barr:Robert Mueller objected to Attorney General Barr's letter clearing President Trump of obstruction

Mark Summers, Assange’s lawyer, told a courtroom packed with journalists and WikiLeaks supporters that his client sought refuge in the Ecuadorian Embassy because "he was living with overwhelming fear of being rendered to the U.S."

Summers said Assange had a "well-founded" fear he would be mistreated and sent to Guantanamo Bay, the U.S. detention camp in Cuba for terrorism suspects.

Assange is a controversial figure: Supporters argue his work has revealed politically uncomfortable truths about the way governments and military operate; critics say he has endangered lives and used subversive and even criminal tactics.

"I found myself struggling with terrifying circumstances," Assange said in a letter read to the court by Summers. Assange apologized for his behavior in 2012.

"I did what I thought was best," he said.

Assange could face up to five years in a U.S. prison if convicted of conspiracy charges in connection with one of the largest leaks of U.S. classified information in history.

Big leaks:Six doozies from Julian Assange's WikiLeaks over the years