Wikileaks founder Julian Assange has been granted asylum by the Ecuadorian embassy in London.
Assange, who has been accused of sexual misconduct by two women in Sweden, had sought refuge in the embassy after a British court had ordered his extradition to Sweden.
He said he was seeking asylum because he fears Sweden would send him to the United States, where he could face the death penalty on espionage charges.
Announcing the decision, Foreign Minister Ricardo Patino said in Ecuador's capital Quito on Thursday: "We consider Assange a journalist and we agree with him that his extradition from Sweden to the US is likely and that threatens his life and integrity. If Assange is sent to the US, he will be tried by the military court and will not receive a fair trial. In light of these facts, the government has decided to grant him asylum."
Earlier in the day, Ecuador had accused the British government of issuing threats and planning to attack the embassy and capture Assange. Patino said the threat was issued via a letter from the UK government.
"Today we received from the United Kingdom an express threat, in writing, that they might storm our embassy in London if we don't hand over Julian Assange," he said.
"Ecuador rejects in the most emphatic terms the explicit threat of the British official communication."
He said such a threat was "improper of a democratic, civilised and rule abiding country".
"If the measure announced in the British official communication is enacted, it will be interpreted by Ecuador as an unacceptable, unfriendly and hostile act and as an attempt against our sovereignty. It would force us to respond," he said.
"We are not a British colony," said Patino.
Assange angered many governments, especially the US, after Wikileaks published thousands of secret diplomatic and military cables and a video of US soldiers killing civilians, including journalists, in Iraq.
Ecuador's decision to grant him asylum doesn't completely end problems for Assange.
Since he is not a diplomat, he doesn't enjoy immunity and can be stopped and arrested if he leaves the embassy for the airport. That means he will have to stay in the embassy until the British government allows him a safe passage, which could take months and even years.