WikiLeaks founder Julian Assange will be questioned by Swedish prosecutors inside the Ecuadorean embassy in London, in a possible breakthrough to the impasse over his case.
The Ecuadorian attorney general delivered a document agreeing to a request by the Swedish prosecutor to question Mr Assange.
He is wanted for questioning over a sex allegation, which he denies, and believes he will be taken to the United States to be quizzed over the activities of WikiLeaks if he goes to Sweden.
Mr Assange has been living inside the embassy for over four years and has been granted political asylum by Ecuador.
He has offered to be questioned inside the embassy but the Swedish prosecutors only recently agreed.
A statement issued in Ecuador said: "In the coming weeks a date will be established for the proceedings to be held at the Embassy of Ecuador in the United Kingdom.
"For more than four years, the government of Ecuador has offered to co-operate in facilitating the questioning of Julian Assange in the Ecuadorian embassy in London, as well as proposing other political and legal measures, in order to reach a satisfactory solution for all parties involved in the legal case against Julian Assange, to end the unnecessary delays in the process and to ensure full and effective legal protection.
"In line with this position, Ecuador proposed to Sweden the negotiation of an Agreement on Mutual Legal Assistance in Criminal Matters, which was signed last December and which provides the legal framework for the questioning."
The statement said the proceedings did not affect the recent opinion of the Working Group on Arbitrary Detentions of the United Nations, which found that Mr Assange was being arbitrarily detained. The working group called for Mr Assange to be released and given compensation for violation of his rights.
The Ecuador statement added: "Ecuador's Foreign Ministry reiterates its commitment to the asylum granted to Julian Assange in August 2012, and reaffirms that the protection afforded by the Ecuadorian state shall continue while the circumstances persist that led to the granting of asylum, namely fears of political persecution."