The government of Ecuador says it has granted political asylum to Julian Assange.
Ricardo Patino, foreign minister, made the announcement during a press conference in Quito on Thursday.
Britain had given warning to Ecuador on Wednesday that it could raid its London embassy if Quito does not handover the WikiLeaks founder, who has been taking refuge at the mission since mid-June.
The Ecuadorean government responded by saying that any such action would be considered a violation of its sovereignty a "hostile and intolerable act".
"Under British law we can give them a week's notice before entering the premises and the embassy will no longer have diplomatic protection," a Foreign Office spokesperson said on Wednesday.
"But that decision has not yet been taken. We are not going to do this overnight. We want to stress that we want a diplomatically agreeable solution."
"We want to be very clear, we're not a British colony. The colonial times are over," Ricardo Patino, Ecuadorean foreign minister, said in an angry statement after a meeting with President Rafael Correa.
"The move announced in the official British statement, if it happens, would be interpreted by Ecuador as an unfriendly, hostile and intolerable act, as well as an attack on our sovereignty, which would force us to respond in the strongest diplomatic way."
Ecuador, whose government is part of a left-leaning bloc of nations in South America, also called for meetings of regional
foreign ministers and the hemispheric Organisation of American States to rally support in its complaint against Britain.
Assange, an Australian citizen, has been in the embassy for eight weeks since losing a legal battle to avoid extradition to Sweden, where he has been accused of rape and sexual assault by two WikiLeaks supporters.
"The UK has a legal obligation to extradite Assange to Sweden to face questioning over allegations of sexual offences
and we remain determined to fulfill this obligation," a Foreign Office spokesperson said earlier.
Swedish prosecutors have not yet charged Assange, but they have moved forward with their investigations and they believe they have a case to take to trial.
Assange fears Sweden could send him on to the US, where he believes authorities want to punish him for publishing thousands of secret US diplomatic cables on WikiLeaks in 2010 in a major embarrassment for the US.
Even if he were granted asylum, Assange has little chance of leaving the Ecuadorean embassy in London without being arrested.
The embassy building, just outside London's famed Harrods department store, was under tight surveillance late into the night, with three police officers manning the entrance and several others patrolling around the premises of the building.
There has been speculation he could travel to an airport in a diplomatic car, be smuggled out in a diplomatic bag, or even
be appointed an Ecuadorean diplomat to give him immunity.
But lawyers and diplomats see those scenarios as practically unworkable.
The Ecuadorean government has said it wants to avoid Assange's extradition to Sweden, but approval of asylum would offer no legal protection in Britain where police will arrest him once they get an opportunity.
"The question of asylum is arguably a red herring," Carl Gardner, a former British government lawyer, said.
Ecuador's leader Correa is a self-declared enemy of "corrupt" media and US "imperialism", and apparently felt compatible with Assange during a TV interview the Australian did with him in May.
Correa joked then with Assange that he had joined "the club of the persecuted".
Some, however, find Assange's connection with Ecuador odd, given that Correa is labelled a persecutor of the media by journalism freedom groups.