LONDON (AP) – 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 offence 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.”

Assange stood impassively with his hands clasped while the sentence was read. His supporters in the public gallery at Southwark Crown Court cheered for him as he left and chanted “Shame on you” at the judge as Assange was led away.

With his white hair freshly coiffed and wearing a black sports jacket and grey sweater, Assange looked much more youthful and healthier than when he was dragged out of the Ecuadorian Embassy by British police on April 11th.

At the time, sporting an unkempt beard and long hair, he seemed wild-eyed and angry. This time he was composed and for the most part polite, although he did interrupt the judge to challenge her on her characterisation of the sexual misconduct allegations he faced in Sweden.

Clinton Supporters and NeverTrump Celebrate Assange Arrest https://t.co/ZaCP8FiR1m — Breitbart London (@BreitbartLondon) April 11, 2019

His lawyer read out a brief letter from Assange to the judge in which he apologised “unreservedly” to anyone who felt his actions had been disrespectful.

“I found myself struggling with terrifying circumstances for which neither I nor those from whom I sought advice could work out any remedy,” he said in the letter. “I did what I thought at the time was the best and perhaps the only thing that could be done.”

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 made by two women.

Sweden suspended its investigation into possible sexual misconduct against Assange two years ago because he was beyond their reach while he was living in the embassy. Prosecutors have said that investigation could be revived if his situation changed.

Wikileaks Founder Julian Assange Backs Brexit https://t.co/Rmpk9KWbxP pic.twitter.com/QTUklpEXGR — Breitbart London (@BreitbartLondon) June 20, 2016

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.” because of his WikiLeaks activities.

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.

Assange was arrested by British police 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.

___

Associated Press writer Jill Lawless contributed.