In an extraordinary move, which surprised his own friends, WikiLeaks founder Julian Assange has sought political asylum at the Ecuadorean Embassy in London after Britain’s Supreme Court dismissed his final appeal against extradition to Sweden to answer allegations of sexual assault.

Police were on Wednesday night standing by to arrest him if he came out of the Embassy.

Mr. Assange, who has been on bail since his arrest in 2010 on a European warrant issued by Sweden, walked into Ecuador’s Embassy in Knightsbridge, near the famous Harrods department store, on Tuesday seeking “diplomatic sanctuary and political asylum.”

Confirming that he was at the Ecuadorean Embassy, he said in a statement that his application was passed to the Ministry of Foreign affairs in Quito, Ecuador’s capital.

“I am grateful to the Ecuadorean Ambassador and the government of Ecuador for considering my application,” he said. The Embassy said it was “studying and analysing” his request. Meanwhile, Mr. Assange would “remain at the Embassy, under the protection of the Ecuadorean government.”

“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.

The British Foreign Office said it would “seek to work with the Ecuadorian authorities to resolve the situation as soon as possible.”

According to police, Mr. Assange faced arrest for breaching his bail conditions that required him to stay at a designated address — his friend Vaughan Smith’s country mansion in Norfolk.

Mr. Smith expressed surprise over Mr. Assange’s dramatic move. Mr. Assange denies sexual assault allegations and fears that if extradited to Sweden he may be handed to American authorities who have threatened to prosecute him for leaking confidential state documents.

More In: International | News