Julian Assange has lost a legal bid overturn an arrest warrant and walk free from Ecuador's embassy in London.

The WikiLeaks founder, 46, has been holed up in the building in Knightsbridge for the past five years.

He was granted shelter by Ecuador in 2012 after being accused of rape in Sweden, which applied to extradite him to stand trial.

The rape allegation, which he denied, was dropped last year but Assange still refused to leave the embassy while a separate UK arrest warrant for breaching his bail conditions remained in effect.

His lawyers made an application to senior district judge Emma Arbuthnot, at Westminster Magistrates' Court, for the UK warrant to be withdrawn, saying it had "lost its purpose and its function".

But today the judge ruled the warrant was still valid.

The WikiLeaks founder caused an international storm in 2010 when he published thousands of secret US diplomatic cables (
Image:
Getty Images Europe)
A 'Free Assange' banner strapped to the embassy fence ahead of the court hearing on his future (
Image:
AFP)

Assange fears being taken into custody if he leaves the embassy and handed over to America to stand trial for the activities of WikiLeaks.

The website caused an international storm in 2010 when it published a series of leaks from US soldier Chelsea Manning.

The leaks enraged Washington and included thousands of secret US diplomatic cables that were highly critical of world leaders, including Vladimir Putin and Saudi Arabia's royal family.

He was seen as a cyber hero for exposing government abuses of power and championing free speech, but to others he was viewed as a criminal who undermined the security of the West by exposing secrets.

Assange posted a photo of himself on Twitter in an Ecuadorian football shirt (
Image:
Twitter)
Photographers and supporters gather outside the embassy in Knightsbridge, west London (
Image:
REX/Shutterstock)

He was supported by a host of celebrity backers in 2010 - including socialite Jemima Khan, who put up some of his bail money.

Ecuador confirmed last month it had granted citizenship to Assange .

Ecuador's Foreign Minister Maria Fernanda Espinosa said Assange was "naturalised" as an Ecuadorian on December 12 at his request.

She said she was seeing a "dignified" solution to his situation with Britain.

The minister previously described Assange's living arrangements in the embassy as "untenable" and said the country was "considering the possibility of mediation".

Assange's leaked US cables came from soldier Chelsea Manning, pictured in 2010 (
Image:
Reuters)

Earlier, the Foreign Office confirmed it had refused a request by Ecuador for Assange to be given diplomatic status.

Ecuador's desire to remove Assange from its embassy reportedly grew when he drew the wrath of President Lenín Moreno after criticising his allies abroad on Twitter last year.

Assange supported the separatist movement in Catalonia, but President Moreno backed the Spanish government - despite accusations of police brutality against political activists - and told Assange to avoid making inflammatory statements about the matter.

But he hit back on Twitter: "If President Moreno wants to gag my reporting of human rights abuses in Spain he should say so explicitly - together with the legal basis."