Julian Assange has been jailed for 50 weeks for breaching his bail after going into hiding in the Ecuadorian embassy in London while he was wanted over allegations of sexual offences.

The WikiLeaks founder spent nearly seven years living in the embassy, where he sought political asylum, until last month when he was dramatically dragged out by police.

Before sentencing by Judge Deborah Taylor for breaching the Bail Act, his lawyer, Mark Summers QC, read a letter written by Assange to Southwark Crown Court on Wednesday.

Assange wrote: "I apologise unreservedly to those who consider that I have disrespected them by the way I pursued my case.

"I found myself struggling with difficult circumstances.

"I did what I thought at the time was the best or perhaps the only thing that I could have done.

"I regret the course that that has taken."

In mitigation for Assange Mark Summers QC, told the court his client had been "gripped" by fears of rendition to the US over the years because of his work with WikiLeaks.

He said: "As threats rained down on him from America, they overshadowed everything as far as he was concerned.

"They dominated his thoughts. They were not invented by him, they were gripping him throughout." 

The 47-year-old entered the embassy on 19 June, 2012 while under intense scrutiny over leaks of hundreds of thousands of classified US diplomatic cables on his whistleblowing website.

The drastic move came after he exhausted all legal options in fighting extradition to Sweden over two separate allegations, one of rape and one of molestation.

Assange, claiming he was the subject of an American "witch hunt", said he was at risk of being further taken to the US if he was sent to the Scandinavian nation.

Tomorrow, he will face a hearing about his potential extradition to the US over the allegation he conspired with intelligence analyst Chelsea Manning to infiltrate Pentagon computers.

Prosecutors in Sweden are also mulling whether to reopen the sexual assault case against Assange, which was dropped in May 2017. Assange denies the allegations.

His eviction from the embassy on 11 April came after a souring of relations, with Ecuador's president Lenin Moreno claiming the Australian had tried to use the Knightsbridge site for spying.

Hours later he was taken to Westminster Magistrates' Court, where he was found guilty of the bail breach, which came when he failed to surrender to police on 29 June, 2012.

Today, the streets leading up to the Southwark court were lined with barriers, with security anticipating groups of demonstrators.

Court One, the largest in the building, attracted queues of journalists awaiting the judgment and members of the public eager to get a glimpse of Assange as he appeared in custody.