Julian Assange. (Photo: acidpolly / Flickr)Caracas, Venezuela – Ecuador said on Thursday that it had decided to grant political asylum to Julian Assange, the founder of WikiLeaks. Seeking asylum, Mr. Assange has been holed up for two months in the Ecuadorean embassy in London, where the police scuffled with and arrested some of his supporters on Thursday.

The announcement was made by the Ecuadorean foreign minister, Ricardo Patiño, at a news conference in Quito. He also said he hoped Britain would permit Mr. Assange to leave the embassy in London for Ecuador — a request Britain has rejected, saying it has a legal obligation to extradite Mr. Assange to Sweden, where is wanted to face questioning about allegations of sexual misbehavior.

The minister said his government had taken the decision after the authorities in Britain, Sweden and the United States had refused to give guarantees that, if Mr. Assange were extradited to Sweden, he would not then be sent on to America to face other charges.

The British Foreign Office said it was disappointed by the Ecuadorean announcement but remained committed to a negotiated outcome to the standoff.

Those close to Mr. Assange have said one reason he does not want to be sent to Sweden is that he fears being charged with crimes in the United States for the release in 2010 of thousands of secret documents and diplomatic cables relating to the wars in Iraq and Afghanistan, as well as to American relations with other governments.

An Ecuadorean official said late Wednesday that the British government had made it clear it would not allow Mr. Assange to leave the country to travel to Ecuador, so even with a grant of asylum or similar protection, he would probably remain stuck in the embassy.

In advance of the announcement from Quito, supporters of Mr. Assange gathered outside the embassy in London on Thursday, refusing police orders to move across the road until officers bundled three of them into police vans and arrested them.

On Wednesday, Mr. Patiño, the foreign minister, said that the British authorities had threatened to barge into the country’s embassy in London if officials did not hand over Mr. Assange. “Today we have received from the United Kingdom an explicit threat in writing that they could assault our embassy in London if Ecuador does not hand over Julian Assange,” Mr. Patiño said at a news conference in Quito, adding defiantly, “We are not a British colony.”

Mr. Assange arrived at the embassy on June 19, seeking to avoid extradition to Sweden, where he is wanted for questioning over accusations that he sexually assaulted two women.

The embassy is in a modest apartment in a redbrick block just behind the Harrods department store in the upscale Knightsbridge neighborhood.

Mr. Assange, said Jérémie Zimmerman, a friend who has spoken with him recently, has found the narrowing of his horizons hard. “It is quite difficult not to be able to get out in the street for all this time,” he said. “He lived for so many years free, without even a home to limit him. And now he is isolated.”

The WikiLeaks founder sleeps on an air mattress in a small office that has been converted to a bedroom, according to accounts of those who have visited him. He has access to a computer and continues to oversee WikiLeaks, his lieutenants have said. Reporters outside the building have seen food being delivered from nearby restaurants.

His presence is a challenge for employees of the embassy. One British government official, citing a conversation with a member of the embassy staff, said that the situation was surreal.

Mr. Assange, who previously lived a nomadic existence staying in the homes of friends, has developed a reputation as a unique houseguest.

Daniel Domscheit-Berg, who ran WikiLeaks with Mr. Assange until the two had a falling-out in 2010, accused Mr. Assange in a memoir of staying for several months, uninvited, and of abusing his cat.

In an interview with The New York Times in early 2011, Mr. Domscheit-Berg added that Mr. Assange had refused to flush the toilet during his entire stay. Mr. Assange has countered that Mr. Domscheit-Berg, and others who have given personal accounts along these lines, are motivated by malice.

A diplomat familiar with Mr. Assange’s situation said that he spent his time in a back room, which gets no direct sunlight. Several weeks ago he had a bad cold and appeared depressed, the source said.

“He can’t get outside to see the sun,” his mother, Christine Assange, said in a recent interview conducted in Quito for BBC Mundo, a BBC Web site. “I’m worried about his health, as I would be for anybody who is having to stay indoors and not get exercise and have sunlight.”

She said some of Mr. Assange’s friends have encouraged him to put on music and dance as a way of getting physical activity and that they had also brought sunlamps.

Under diplomatic protocol, Mr. Assange was thought to be off limits while in the embassy. But the BBC reported Wednesday that British officials had raised the notion of revoking the diplomatic immunity of the Ecuadorean Embassy, allowing British officials to enter.

A spokeswoman for Britain’s Foreign and Commonwealth Office declined to make the government’s correspondence with the Ecuadoreans public. But in a statement, the Foreign Office said it had consistently made its position clear in discussions.

“The U.K. has a legal obligation to extradite Mr. Assange to Sweden to face questioning over allegations of sexual offenses, and we remain determined to fulfill this obligation,” the statement said. British officials have “drawn the Ecuadoreans’ attention to relevant provisions of our law,” the statement said, but the government is “still committed to reaching a mutually acceptable solution.”

Although WikiLeaks has shrunk substantially during the 20 months of Mr. Assange’s legal battle in Britain, losing many of its most skilled computer experts along with several of Mr. Assange’s closest associates in building the organization, it has continued to issue statements about his plight.

On Thursday, ahead of the Ecuadorean decision, it issued a new, unsigned statement describing Britain’s warning that it might suspend the embassy’s immunity as part of an action to arrest Mr. Assange as a “resort to intimidation” and a breach of the Vienna Convention governing diplomatic relations between states.

“We remind the public that these extraordinary actions are being taken to detain a man who has not been charged with any crime in any country,” the statement said. It added: “We further urge the U.K. government to show restraint, and to consider the dire ramifications of any violation of the elementary norms of international law.”

It struck many as odd that Mr. Assange, who shot to fame as a fighter for media freedom, chose Ecuador as a potential refuge. Mr. Correa has presided over a crackdown on journalists there.

But when Mr. Assange arrived at the embassy, he issued a statement saying that Mr. Correa had invited him to seek asylum in Ecuador during an interview for Mr. Assange’s TV show on Russia Today, an English-language cable channel financed by the government of Vladimir V. Putin.

William Neuman reported from Caracas, and Maggy Ayala from Quito, Ecuador. John F. Burns, Ravi Somaiya and Alan Cowell contributed reporting from London.