Julian Assange has been sentenced to 50 weeks in jail for skipping bail in 2012, after a judge said it was "difficult to envisage a more serious example of this offence".
The maximum possible sentence was one year.
Assange skipped bail - after an extradition order to Sweden over an allegation of rape - because he was terrified of being "renditioned" to Guantanamo Bay on charges that could lead to the death penalty in the US, the court had been told.
But Judge Deborah Taylor told Assange at Southwark Crown Court in London, "you had a choice, and your course of action you chose was to commit this offence".
"This was a deliberate attempt to evade or delay justice," she said. It had cost £16 million to station police around the embassy to ensure Assange was brought to justice.
"It is essential to the rule of law that nobody is above or beyond the reach of the law," the judge said.
In a handwritten statement penned on Wednesday morning, Assange apologised "unreservedly" for skipping bail, saying he had found himself "struggling with terrifying circumstances" that neither he nor his advisers could find a way out of. He had thought skipping bail would protect him from "the worst of my fears".
Assange's defence lawyer Mark Summers, QC, said Assange was "just short of [having a] reasonable excuse" for skipping bail. The background was "an act of seeking and claiming asylum, itself a lawful act", Summers said.
"These are unusual, difficult and different circumstances… [he] had strongly held fears of being removed to the United States. The fear was [of] onward removal from Sweden to America and even Guantanamo Bay." Summers said it was "obvious they were reasonable fears".
Assange has trimmed his beard and had a haircut since his arrest in April. He was wearing a black jacket, a grey T-shirt and blue jeans. He watched proceedings attentively, occasionally sipping water.
Summers said Assange had suffered as a result of his decision, with his time in the embassy "equitable to prison" without access to treatment for a painful frozen shoulder and chronically painful fractured tooth.
Assange, 47, entered Ecuador's London embassy on June 19, 2012. He spent almost seven years in the embassy, a small office in an apartment block behind Harrods in Knightsbridge.
EXTRADITION HEARING DUE
Assange is set to face his first US extradition hearing in London later this week, with the case likely to boil down to the WikiLeaks founder's motivations and whether he acted as a journalist or a computer hacker.
The Australian's appearance via video link at Westminster Crown Court on Thursday will likely be a procedural formality but new details about the US case against him could be revealed.
The US Justice Department has charged him with conspiracy to commit computer intrusion with former American army intelligence analyst Chelsea Manning in 2010.
The US has already had difficulty in building its extradition case, with Manning refusing to testify about Assange before a grand jury. She has been jailed for her refusal.
The crux of the US accusation is that Assange tried to help Manning hack a password on a Pentagon computer system nine years ago.
The Justice Department alleges that cracking the code would have made it harder for authorities to identify Manning as Assange's source for more than 750,000 classified military and diplomatic documents that were published by WikiLeaks.
"Cracking the password would have allowed Manning to log on to the computers under a username that did not belong to her. Such a deceptive measure would have made it more difficult for investigators to determine the source of the illegal disclosures," the indictment says.
The US Attorney's Office alleges Assange told Manning he had tried to crack the password but "had no luck yet".
Glen Greenwald and Micah Lee of the online news outlet The Intercept claim that Assange was merely trying to maintain Manning's anonymity, as any journalist would.
"Assange was not trying to hack into new document files to which Manning had no access, but rather trying to help Manning avoid detection as a source. For that reason, the precedent that this case would set would be a devastating blow to investigative journalists and press freedom everywhere," they wrote.
So Assange's motivation for trying to help Manning is likely to be central to the US case - whether he was trying to protect his source's identity or trying to help Manning hack into the system to access new, previously inaccessible data.
The debate about whether Assange is a journalist or a hacker has been swirling around the WikiLeaks founder for more than a decade.
If Assange is considered a journalist, granting his extradition would set a historic legal precedent.
"This precedent means that any journalist can be extradited for prosecution in the United States for having published truthful information about the United States," his lawyer Jennifer Robinson has said.
But extraditing Assange as a hacker would also create a sensation in British courts, which have recently protected two high-profile hackers from US extradition.
Lauri Love, a friend of Assange, and Gary McKinnon were set to be extradited for allegedly hacking US military networks but recently had UK courts rule in their favour.
Love's legal team included Assange's lawyer Ms Robinson.
Somewhat muffled by the louder debate about US extradition is the pressing matter of a potential extradition application from Sweden, which has been wanting to question Assange about an allegation of rape lodged in 2010.
Three other cases, that also involve a second woman, were dropped in 2015 after the statute of limitations ran out.
Sweden is still yet to lodge a fresh extradition request but women's groups have been piling pressure on British Home Secretary Sajid Javid to prioritise any Swedish application.
Sarah Green, co-director of End Violence Against Women, called the downplaying of the sex accusations against Assange "undignified".
"This is serious - the harm rape does, even the impact it has when people dangle it around in the news as though it's a trivial part of the story," she told The Guardian last week.
- Sydney Morning Herald and AAP