A British judge sentenced WikiLeaks founder Julian Assange on Wednesday to 50 weeks in prison for skipping bail seven years ago and holing up in the Ecuadorian embassy.

Judge Deborah Taylor said it was hard to imagine a more serious version of the offense as she gave the 47-year-old hacker a sentence close to the maximum of a year in custody.

She said Assange’s seven years in the embassy had cost British taxpayers 16 million pounds ($21 million), and said he sought asylum as a “deliberate attempt to delay justice.”

Protesters outside court as Julian Assange will appear to be sentenced on charges of jumping British bail seven years ago, in London, Wednesday May 1, 2019. Founder of WikiLeaks whistleblower site, Assange faces a separate court hearing later, on a U.S. extradition request, after being arrested at the Ecuadorian embassy April 11, when his political asylum was withdrawn.(AP Photo/Matt Dunham)
Protesters outside court as Julian Assange will appear to be sentenced on charges of jumping British bail seven years ago, in London, Wednesday May 1, 2019. Founder of WikiLeaks whistleblower site, Assange faces a separate court hearing later, on a U.S. extradition request, after being arrested at the Ecuadorian embassy April 11, when his political asylum was withdrawn.(AP Photo/Matt Dunham)

The white-haired Assange stood impassively with his hands clasped while the sentence was read. His supporters in the public gallery at Southwark Crown Court chanted “Shame on you” at the judge as Assange was led away.

The Australian secret-spiller sought asylum in the South American country’s London embassy in June 2012 to avoid extradition to Sweden, where he was wanted for questioning over rape and sexual assault allegations.

An interactive timeline on Julian Assange since the Wikileaks shutdown in 2008

Protesters outside court as Julian Assange will appear to be sentenced on charges of jumping British bail seven years ago, in London, Wednesday May 1, 2019. Founder of WikiLeaks whistleblower site, Assange faces a separate court hearing later, on a U.S. extradition request, after being arrested at the Ecuadorian embassy April 11, after his political asylum was withdrawn. (AP Photo/Matt Dunham)
Protesters outside court as Julian Assange will appear to be sentenced on charges of jumping British bail seven years ago, in London, Wednesday May 1, 2019. Founder of WikiLeaks whistleblower site, Assange faces a separate court hearing later, on a U.S. extradition request, after being arrested at the Ecuadorian embassy April 11, after his political asylum was withdrawn. (AP Photo/Matt Dunham)

Assange’s lawyer Mark Summers 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.”

He said Assange had a “well-founded” fear that he would be mistreated and possibly sent to the U.S. detention camp for terrorism suspects at Guantanamo Bay.

Summers read a letter from Assange apologizing for his behavior in 2012 and saying “I did what I thought was best.”

Protesters outside court as Julian Assange will appear to be sentenced on charges of jumping British bail seven years ago, in London, Wednesday May 1, 2019. Founder of WikiLeaks whistleblower site, Assange faces a separate court hearing later, on a U.S. extradition request, after being arrested at the Ecuadorian embassy April 11, when his political asylum was withdrawn. (AP Photo/Matt Dunham)
Protesters outside court as Julian Assange will appear to be sentenced on charges of jumping British bail seven years ago, in London, Wednesday May 1, 2019. Founder of WikiLeaks whistleblower site, Assange faces a separate court hearing later, on a U.S. extradition request, after being arrested at the Ecuadorian embassy April 11, when his political asylum was withdrawn. (AP Photo/Matt Dunham)

“I found myself struggling with terrifying circumstances,” the letter said.

Assange was arrested April 11 after Ecuador revoked his political asylum, accusing him of everything from meddling in the nation’s foreign affairs to poor hygiene.

He faces a separate court hearing Thursday on a U.S. extradition request. American authorities have charged Assange with conspiring to break into a Pentagon computer system.

Protesters stand with media journalists outside court as Julian Assange is to appear at court to be sentenced on charges of jumping British bail seven years ago, in London, Wednesday May 1, 2019. Founder of WikiLeaks Assange was arrested at the Ecuadorian embassy April 11, after his political asylum was withdrawn. (AP Photo/Matt Dunham)
Protesters stand with media journalists outside court as Julian Assange is to appear at court to be sentenced on charges of jumping British bail seven years ago, in London, Wednesday May 1, 2019. Founder of WikiLeaks Assange was arrested at the Ecuadorian embassy April 11, after his political asylum was withdrawn. (AP Photo/Matt Dunham)
Protesters outside court as WikiLeaks founder Julian Assange will appear in court to be sentenced on charges of jumping British bail seven years ago, in London, Wednesday May 1, 2019. Assange was arrested at the Ecuadorian embassy April 11, after his political asylum was withdrawn. (AP Photo/Matt Dunham)
Protesters outside court as WikiLeaks founder Julian Assange will appear in court to be sentenced on charges of jumping British bail seven years ago, in London, Wednesday May 1, 2019. Assange was arrested at the Ecuadorian embassy April 11, after his political asylum was withdrawn. (AP Photo/Matt Dunham)
Protesters outside court as Julian Assange is to appear at court to be sentenced on charges of jumping British bail seven years ago, in London, Wednesday May 1, 2019. Founder of WikiLeaks Assange was arrested at the Ecuadorian embassy April 11, after his political asylum was withdrawn. (AP Photo/Matt Dunham)
Protesters outside court as Julian Assange is to appear at court to be sentenced on charges of jumping British bail seven years ago, in London, Wednesday May 1, 2019. Founder of WikiLeaks Assange was arrested at the Ecuadorian embassy April 11, after his political asylum was withdrawn. (AP Photo/Matt Dunham)
Protesters outside court as Julian Assange will appear to be sentenced on charges of jumping British bail seven years ago, in London, Wednesday May 1, 2019. Founder of WikiLeaks whistleblower website, Assange faces a separate court hearing later, on a U.S. extradition request, after being arrested at the Ecuadorian embassy April 11, when his political asylum was withdrawn. (AP Photo/Matt Dunham)
Protesters outside court as Julian Assange will appear to be sentenced on charges of jumping British bail seven years ago, in London, Wednesday May 1, 2019. Founder of WikiLeaks whistleblower website, Assange faces a separate court hearing later, on a U.S. extradition request, after being arrested at the Ecuadorian embassy April 11, when his political asylum was withdrawn. (AP Photo/Matt Dunham)

View more: