WikiLeaks founder Julian Assange has been sentenced to 50 weeks in prison for fleeing to the Ecuadorian embassy in London while on bail in 2012. At the time, he was facing possible extradition to Sweden on sexual assault charges.

Assange remained in the embassy until last month, when he was evicted by his Ecuadorian hosts and re-arrested by British authorities.

Wednesday's sentencing is unlikely to be the end of Assange's legal problems. Shortly after he was re-arrested last month, US authorities unsealed an indictment charging him with conspiring with Chelsea Manning to crack a hashed password belonging to a Pentagon computer in 2010. At the time, Manning was an Army private leaking confidential military documents to WikiLeaks. Assange was unable to learn the password, but the US argues that his attempt is sufficient to charge him with conspiracy.

In a letter to the court, Assange argued that he had fled to the embassy out of fear that he'd be extradited to the United States and wind up being held indefinitely at the US prison camp at Guantanamo Bay, Cuba.

"I found myself struggling with terrifying circumstances for which neither I nor those from whom I sought advice could work out any remedy," Assange wrote, according to the Guardian.

But the WikiLeaks founder got little sympathy from the judge, who said that Assange had chosen to remain in the embassy for seven years, making a mockery of the British justice system.

"You exploited your privileged position to flout the law and advertised internationally your disdain for the law of this country," the judge said.

Swedish authorities dropped the sexual assault charges against Assange in 2017 because they couldn't move it forward with Assange hiding in the embassy. Prosecutors could re-open the case now that he is in British custody.