She acknowledged that Britain had rebuffed Ecuador’s request that Mr. Assange be given diplomatic status.
Mr. Assange initially sought refuge in the embassy after Sweden sought to have him arrested in connection with allegations of rape and assault. Although Sweden is no longer seeking his extradition, Mr. Assange has refused to leave, saying that he fears Britain would extradite him to the United States to face charges relating to his involvement in multiple releases of documents that American officials say have damaged national security.
He has managed to wear out his welcome over the years, alienating many of his previous supporters, including Edward J. Snowden, the former American intelligence contractor who leaked documents about surveillance programs.
Mr. Assange also offended potential supporters in the Democratic Party by allowing WikiLeaks to become the conduit for emails hacked by Russia from the Democratic National Committee that were intended to harm the presidential candidacy of Hillary Clinton.
American intelligence agencies have concluded that Russian hackers working for the Kremlin carried out the intrusions, but Mr. Assange has always insisted that he did not know the source of the emails, under the working rules of WikiLeaks. He has denied working for Russia or any other government.
The United States attorney general, Jeff Sessions, has said that arresting Mr. Assange is a priority. “We have professionals that have been in the security business of the United States for many years that are shocked by the number of leaks, and some of them are quite serious,” he said last year.
When Swedish prosecutors dropped their effort to have Mr. Assange extradited last year, they said it was not for reasons of guilt or innocence but because they saw no hope of compelling him to leave the embassy.
However, the British police say that he is still subject to arrest on charges of jumping bail, and Mr. Assange faces the strong possibility that the United States has issued a secret arrest and extradition warrant in connection with his assistance to Chelsea Manning, the Army private who was convicted of revealing state secrets.
The decision to grant citizenship comes amid flurry of activity suggesting that the Ecuadorean government had ramped up efforts to find a solution for Mr. Assange. The country said on Tuesday that it was looking for a third-party mediator who could broker a deal to allow Mr. Assange to leave the embassy.
“We’re considering, exploring the possibility of a mediation,” Ms. Espinosa said, according to Reuters. “No solution can be reached without international cooperation and without cooperation from the United Kingdom, which in addition has shown interest in finding a solution.”
Greg Barns, a lawyer who advises Mr. Assange and WikiLeaks, said in a telephone interview from New Zealand that the situation was “intolerable” for his client and for Ecuador.
The embassy is in the affluent Knightsbridge section of London, but he said Mr. Assange had been effectively “imprisoned with no access to natural light and fresh air for a period of five and a half years.”
Mr. Barns suggested that the Australian government would be an obvious third-party mediator, given that Mr. Assange is a citizen of Australia, which has excellent relations with Britain.
Mr. Barns also said that he had previously asked Prime Minister Malcolm Turnbull of Australia, a former colleague, to intervene, but that he had not received a response.