A spokesman for Sweden’s Foreign Ministry, Anders Jorle, said the country’s legal system had been impugned and the Ecuadorean ambassador had been summoned.

In Sweden, Claes Borgstrom, the lawyer representing the two women who have accused Mr. Assange of sexual abuses, told the online newspaper Expressen.se that the women had expected the decision but still thought it absurd and were disappointed.

“Assange is a coward,” Mr. Borgstrom said. “He is accused of assault, but he is totally uninterested in my clients. He has shifted his focus elsewhere.”

Mr. Patiño’s news conference was broadcast live on British television and Mr. Assange watched the announcement as it happened, British news reports said. He told embassy staff members: “It is a significant victory for myself and my people. Things will probably get more stressful now.”

Outside the embassy, a small red brick apartment block behind Harrods department store in the upscale Knightsbridge neighborhood, a protester with a megaphone provided sporadic updates on the progress of the news conference in Quito. When it became clear that Mr. Assange had won asylum, the response was a muted joy. “It’s great news,” said a youth worker, 21, who gave his name only as James. “As long as Britain honors his right to asylum,” he added, outlining his hope that the British government would allow Mr. Assange to leave the country without arresting him. If that does not happen, he said, gesturing to the protesters around him, “this will only get bigger.” Like many of the protesters, the youth worker said he believed that the accusations of sexual abuse against Mr. Assage were part of a conspiracy to silence WikiLeaks. “Textbook character assassination,” he said.

Speculation immediately turned to whether, and how, Mr. Assange might seek to escape.

Mr. Patiño said his government had made its decision after the authorities in Britain, Sweden and the United States refused to give guarantees that if Mr. Assange were extradited to Sweden, he would not then be sent on to the United States to face other charges.