Assange skipped bail and stayed at the Ecuadorian Embassy in London to avoid extradition to Sweden, where he was wanted on sexual assault allegations, which he has denied. He was arrested at the embassy in mid-April.
In a letter read to the court, Assange apologized to those who "consider I have disrespected them," and said he had struggled in difficult circumstances.
British Judge Deborah Taylor handed him a sentence just under the maximum term for the offense, which was a full year, saying he displayed a "disdain for the law of this country."
The judge said Assange should have left the embassy to face due process "with the rights and protections which the legal system in this country provides."
Taylor also threw out a suggestion from his defense that his seven years in the embassy should have offset any prison sentence. He will face at least half his sentence behind bars if he does not commit further crimes.
This is far from the end of Assange's legal troubles.
He is also wanted in the U.S. in connection with one of the largest thefts of classified government information in American history. The U.K. has an extradition treaty with the U.S., depending on an assurance that wanted persons do not face the death penalty, which is outlawed in the U.K.
Hours after he was arrested by British authorities in April, U.S. prosecutors announced charges against him for allegedly conspiring with former intelligence officer Chelsea Manning to gain unlawful access to a government computer.
The indictment, which was filed in March 2018, claims Assange helped Manning crack a password on a Pentagon computer.
In 2013, Manning was sentenced to 35 years in prison for the offense, but her sentence was commuted by President Barack Obama as one of his final acts in office.
Meanwhile, Assange had fled to the Ecuadorian embassy in June 2012, where he remained until this past April 11. While the Ecuadorians were staunch advocates of his protection, in recent years the relationship between them and Assange soured.
WikiLeaks continued to publish controversial material, including stolen material from the Democratic National Committee during 2016. This caused discomfort for the Ecuadorians, who cut off his communications in March.
Relations further deteriorated after the 2017 election of Lenin Moreno, who described Assange as "a spoiled brat" and "a thorn in our side" after he was ousted from the embassy. Moreno repeated allegations by embassy staff that Assange displayed aggressive behavior and smeared feces on walls.