Julian Assange has dramatically sought political asylum at the Ecuadorean embassy in London, days after the supreme court rejected the last of his appeals against extradition to Sweden to face sex crime accusations and after what he called a "declaration of abandonment" by his own government in Australia.

In a move that appears to have surprised even some of his closest supporters, the WikiLeaks founder walked into the country's embassy in Knightsbridge and asked for asylum, citing the UN declaration of human rights.

"I can confirm I arrived at the Ecuadorean embassy and sought diplomatic sanctuary and political asylum," Assange said in a statement.

"This application has been passed to the ministry of foreign affairs in the capital Quito. I am grateful to the Ecuadorean ambassador and the government of Ecuador for considering my application."

The audacious bid came less than a week after the supreme court finally rejected his appeal against extradition to Sweden, where he is wanted for questioning in connection with accusations of the rape of one woman and sexual assault on another in August 2010, which he denies.

Assange and his supporters have argued that his removal to Sweden could be followed by a possible onward extradition to the US on potential espionage charges, saying he is at risk of the death penalty.

The US government opened a grand jury investigation in May 2011 into the passing of hundreds of thousands of secret US embassy cables to WikiLeaks, the first stage in a process of deciding whether or not to prosecute Assange. No request for extradition to the US has been made, however.

In a statement on its site, WikiLeaks said that in a meeting with Assange's legal adviser in May, the Australian government had issued "an effective 'declaration of abandonment', refusing to protect Mr Assange, or make any requests on his behalf".

Assange had been given until 28 June to lodge an appeal against the UK court's decision at the European court of human rights in Strasbourg. Some legal commentators have doubted whether Assange would have strong grounds to take his appeal to the court in Strasbourg.

He may have decided on his dramatic switch in tactics having been discouraged about his chances of success in Europe's highest court. Assange is currently on £240,000 police bail, a sum posted by a number of high-profile friends and supporters. Last month Assange interviewed the socialist Ecuadorean president Rafael Correa for his TV show The World Tomorrow, broadcast on the Russian state-sponsored channel Russia Today. The WikiLeaks founder described Correa as "a leftwing populist who has changed the face of Ecuador".

It was unclear whether any explicit or informal offer of asylum had been made by the president during the interview, though the country's deputy foreign minister said in 2010 that Ecuador would offer him residency without conditions.

Assange's presence will focus attention on the extent of diplomatic immunity for foreign embassies in the UK. In a statement, the Ecuadorean embassy said: "This afternoon Mr Julian Assange arrived at the Ecuadorean embassy seeking political asylum from the Ecuadorean government. We have immediately passed his application on to the relevant department in Quito. While the department assesses Mr Assange's application, Mr Assange will remain at the embassy, under the protection of the Ecuadorean government."

"The decision to consider Mr Assange's application for protective asylum should in no way be interpreted as Ecuador interfering in the judicial processes of either the United Kingdom or Sweden."

"As Mr Assange is in the Ecuadorean embassy he is on diplomatic territory and beyond the reach of the police," the Foreign Office said. "We will seek to work with the Ecuadorean authorities to resolve this situation as soon as possible."

Ecuador's justice system and record on free speech have been called into question by a number of campaigning organisations including Reporters Without Borders, the Committee to Protect Journalists, and Amnesty International.

"I think this is ironic that you have a journalist, or an activist, seeking political asylum from a government that has – after Cuba – the poorest record of free speech in the region, and the practice of persecuting local journalists when the government is upset by their opinions or their research," said José Miguel Vivanco, director of Human Rights Watch's Americas division.

In April 2011, Ecuador expelled the US ambassador Heather Hodges following the publication of diplomatic cables by WikiLeaks alleging widespread corruption within the Ecuadorean police. The WikiLeaks founder has been in custody and on bail in the UK since autumn 2010. The activist Jemima Khan confirmed on Twitter that she had put up bail for Assange, saying: "I had expected him to face the allegations. I am as surprised as anyone by this."

The Australian journalist Phillip Knightley, said he had also offered £20,000 in surety for Assange, but he had no regrets about putting his money at stake. "I'm not worried about my commitment. I would do it again. He's an Australian and he deserves my compatriot's support. He's been treated terribly by the British and Swedish justice systems and I think he's the victim of a conspiracy." Assange, he said, had sought asylum only "after exhausting every other possible remedy".

Vaughan Smith, the founder of the Frontline Club in whose Norfolk mansion Assange spent much of his period on bail, said: "I certainly didn't expect this to happen." "One deduces from it that he doesn't feel he's going to get justice by going to Sweden. I feel sure that Julian will have gone to the embassy feeling that he wasn't going to get justice otherwise. I do feel he's been painted unfavourably."

Assange has not been charged with any crime in Sweden, and vehemently denies any wrongdoing in relation to the two women. Joakim Nergelius, a professor of jurisprudence and law at Örebro University, told the Swedish paper Dagens Nyheter that since the basis of Sweden's extradition request is the European arrest warrant, it was "quite impossible to assess the possible legal implications" should he be granted asylum.

The Ministry of Justice said that responsibility for handling his extradition rested with the Serious Organised Crime Agency (Soca) which deals with European arrest warrant requests. Neither Soca, the Metropolitan police, whose extradition unit arrested Assange in December 2010, nor the Crown Prosecution Service would comment.