Sentencing at a packed Southwark Crown Court, Judge Deborah Taylor said: “You remained there ... exploiting your privileged position to flout the law and advertise internationally your disdain for the law of this country.”
Assange now faces a separate hearing on Thursday to decide if he can be extradited to the US where he is accused of orchestrating one of the largest ever leaks of government secrets.
The sentencing hearing on Wednesday heard how the 47-year-old Australian had remained living in Ecuador’s embassy – out of reach of British police – until his asylum was withdrawn last month and officers were invited in to arrest him.
In a letter read out in court, Assange apologised to “those who consider that I have disrespected them by the way that I have pursued my case”.
He added: “This is not what I wanted or intended. I found myself struggling with terrifying circumstances for which neither I nor those from whom I sought advice could work out any remedy. I did what I thought at the time was the best.”
Mark Summers QC, for Assange, said the secret-spiller had only gone on the run because he believed he may end up at America’s infamous prison camp Guantanamo Bay.
“The fear was [of] onward removal from Sweden to America and even Guantanamo Bay,” said Mr Summers.
He added: “[There were] suggestions from inside the US administration that he could be kidnapped wherever he was with or without the approval of the country in which he was residing and brought forcibly to the US. That is no less than the threat of a rendition.”
But Judge Taylor dismissed the claim and said it was difficult to imagine a more serious example of a breach of bail case.
“By hiding in the embassy you deliberately put yourself out of reach, while remaining in the UK,” she said, adding he had cost the British taxpayer £16m.
As the convict was led down to the cells, he raised a defiant fist to supporters in the public gallery.
Sweden itself has since withdrawn its extradition request for Assange – who denies the allegations – but he remains wanted in the US on charges of conspiring to hack into Pentagon computers and aiding whistleblower Chelsea Manning. He faces up to five years in prison if extradited and found guilty.
The accusations date back to 2006 when Wikileaks published hundreds of thousands of secret diplomatic cables and files that laid bare US intelligence and was said to have put the lives of hundreds of its staff at risk.
The website followed that, in 2010, by publishing a classified US military video showing a 2007 helicopter attack which killed 18 civilians in Iraq.