Wikileaks founder Julian Assange is seeking political asylum at Ecuador's London embassy.
The South American country says it is "studying and analysing the request".
Last week, the UK's Supreme Court dismissed Mr Assange's bid to reopen an appeal against extradition to Sweden over alleged sex crimes.
He fears that if he is sent to Sweden it may lead to him being sent to the US to face charges over Wikileaks for which he could face the death penalty.
Mr Assange denies any wrongdoing.
Swedish authorities have said the European Court of Human Rights (ECHR) would intervene if Mr Assange was to face the prospect of "inhuman or degrading treatment or an unfair trial" in the US.
The UK Foreign Office - which said that as Mr Assange was now in the embassy he was "on diplomatic territory and beyond the reach of the police" - added that it would work with Ecuador to resolve the situation.
In 2010, Mr Assange - whose Wikileaks website has published a mass of leaked diplomatic cables that embarrassed several governments and international businesses - was briefly offered Ecuadorean residency.
But the offer from the country's deputy foreign minister - who said he was acting because Ecuador wanted to allow Mr Assange to freely present the information he had - was dismissed by President Rafael Correa who said he had not approved it.
Swedish prosecutors want to question Mr Assange over allegations of rape and sexual assault while he was in Stockholm to give a lecture.
The claims were made by two female Wikileaks supporters in mid-2010. No charges have been filed.
The Australian anti-secrecy campaigner, who claims the sex was consensual, could still take his case against extradition to the ECHR and has until 28 June to make the move, or extradition proceedings will begin.
Mr Assange is on £200,000 bail which was provided by several high-profile supporters including socialite Jemima Khan and Ken Loach, who each offered £20,000 as surety.
In a statement, Ecuador's embassy in London said Mr Assange arrived there on Tuesday afternoon to seek asylum.
"As a signatory to the United Nations Universal Declaration for Human Rights, with an obligation to review all applications for asylum, we have immediately passed his application on to the relevant department in Quito," it said.
"While the department assesses Mr Assange's application, Mr Assange will remain at the embassy, under the protection of the Ecuadorean government."
It said the decision to consider the bid for asylum "should in no way be interpreted as the government of Ecuador interfering in the judicial processes of either the United Kingdom or Sweden".
Ecuador would seek the views of the governments of the UK, Sweden and the US before making its decision, it added.
Mr Assange issued a statement, saying he was "grateful to the Ecuadorean ambassador and the government of Ecuador for considering my application".
Associated Press quoted Ecuador foreign minister Ricardo Patino as telling reporters Mr Assange had written to Ecuadorean President Rafael Correa saying he was being persecuted.
Mr Assange feared Sweden would not protect him from being extradited to "a foreign country that applies the death penalty for the crime of espionage and sedition," Mr Patino said.
Labour peer and human rights lawyer Baroness Helena Kennedy QC said she understood his Swedish lawyers had warned him that if extradited to their country - which had been expected imminently - he would be handed over to the US at the conclusion of the sexual assaults investigation.
But she told BBC Radio 4's Today programme: "In international law, a country to which a person is surrendered should only deal with him on the offences for which he has been surrendered and, at the moment it's finished, he should be allowed to exit that country."
If Sweden could provide such an undertaking, it was likely Ecuador would be happy to let Mr Assange proceed there, she added.
Jemima Khan, one of several supporters to help put up Mr Assange's £200,000 bail, said on Twitter that she had expected him to face the allegations, adding: "I am as surprised as anyone by this".
Baroness Kennedy said that, as it was known exactly where Mr Assange was, his supporters would have a strong argument for getting their money back because bail was usually put up to prevent flight or to ensure attendance at court.
Vaughan Smith, a friend who allowed Mr Assange to stay at his Norfolk home until December 2011, told the BBC he was surprised by the move but understood why he may have decided to seek asylum.
"There's been an organised campaign to undermine him," Mr Smith said, "and he believed that if he was sent to Sweden he would be sent to America."
Wikileaks has posted an alert on its Twitter feed: "ALERT: Julian Assange has requested political asylum and is under the protection of the Ecuadorean embassy in London."