A judge in Ecuador has ruled against WikiLeaks co-founder Julian Assange, who had contested new rules imposed on him in the country's embassy in London.
The judge said a requirement to pay for internet use and clean up after his cat did not violate his right to asylum.
Mr Assange had argued that the conditions violated his "fundamental rights and freedoms", and were intended to force him to leave.
His lawyers have appealed against the ruling.
Mr Assange took refuge in the embassy six years ago to avoid extradition to Sweden in a sexual assault case that has since been dropped.
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.
WikiLeaks lawyer Baltasar Garzón launched the legal action in Ecuador earlier this month and Mr Assange addressed the hearing in the capital, Quito, on Monday via teleconference.
He said Ecuador was trying to end his asylum in the embassy which would see him extradited to the US. The US Attorney General Jeff Sessions has said that arresting Julian Assange is a "priority".
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.