If he leaves the building he faces arrest for allegedly breaching bail conditions.

Earlier this month, Mr Assange was given a new set of house rules by the London embassy that included paying for internet use and taking better care of his cat. He was also asked to keep the bathroom clean and pay for his own food and laundry.

Image copyrightReutersImage caption
Mr Assange was given the cat by his children

Image copyrightReutersImage caption
Julian Assange has been holed up in the embassy in London since 2012

Ecuador's Attorney General Iñigo Salvador said that if Mr Assange wanted to stay "and he follows the rules... he can stay at the embassy as long as he wants". He added that his time at the embassy had so far cost Ecuador $6m (£4.6m).

Judge Karina Martínez ruled against Mr Assange, saying that the foreign ministry was in charge of determining his living conditions.

Mr Assange's legal team launched an appeal which will be heard by a higher court in the coming days.

In March, the embassy in London removed Mr Assange's internet connection, accusing him of "interfering in other countries' affairs".

It later said it would be partially restored.

WikiLeaks was set up by Mr Assange and a group of like-minded friends in 2006 as a site where whistleblowers could send confidential documents and images to be published online.

The site came to prominence with the release of footage in 2010 of a US military helicopter shooting civilians in Iraq.