WikiLeaks founder Julian Assange has been jailed for 50 weeks for violating his U.K. bail conditions in 2012 at a sentencing hearing at Southwark Crown Court today.

A spokeswoman for the court confirmed the almost-year long custodial sentence via email — which falls just short of the 12-month maximum carried by the offence.

In a tweet following Assange’s sentencing Wikileaks branded it “shocking” and “vindictive”.

He had already been found guilty of breaching his bail conditions at a hearing last month which followed his arrest in the Ecuadorian Embassy — after the country withdrew the diplomatic asylum it had previously granted him.

Assange fled to the Ecuadorian embassy in London in 2012, seeking to evade extradition to Sweden where he was facing rape accusations, claiming he was afraid the country would extradite him to the U.S.

What followed was almost seven years of self-imposed incarceration in the embassy — until his host’s patience finally wore thin.

During this time Swedish prosecutors also dropped their cases against him, seeing no prospect of extracting him from the diplomatic asylum he was being shielded by.

In a letter read out by his lawyer in court, The Guardian reports that Assange apologized “unreservedly to those who consider that I have disrespected them by the way I have pursued my case”, claiming he had been afraid of the “terrifying circumstances” he found himself in — and saying he now regrets his decision to flee.

Once in U.K. police custody last month Assange was immediately rearrested on behalf of the U.S. — which has charged him with conspiracy to hack into a classified computer, and is seeking his extradition.

The 50-week jail sentence means he will remain behind bars in the U.K. as he begins his fight against extradition to the U.S.

The U.S. charge relates to the leak, almost a decade ago, of classified military information that was passed by former army intelligence analyst and whistleblower, Chelsea Manning, to WikiLeaks.

Documents leaked by Manning and published by WikiLeaks included hundreds of thousands of battlefield reports from Afghanistan and Iraq which showed, among other unflattering revelations, that the U.S. military had killed more civilians than had been officially reported.

Assange has sought to claim ‘journalist’ status and First Amendment free speech protections for publishing the classified information. But U.S. prosecutors are alleging the WikiLeaks’ founder helped Manning crack a password which allowed her to gain access to classified information that she otherwise would not have been able to leak.

If extradited to the U.S. and convicted on these charges Assange faces up to five years in prison.

He’s due back in U.K. court on Thursday for a hearing on the U.S.’ extradition request.

In parallel, Manning is also behind bars in the U.S. — having been jailed for refusing to testify to a grand jury investigating WikiLeaks.

Her original 35-year sentence for leaking classified military documents was commuted to seven years by former US president Barack Obama.