Ecuador says it will let Swedish officials interview Julian Assange at its embassy in London, where he has been taking refuge for the past four years to avoid possible extradition to Sweden.
The WikiLeaks founder is wanted for questioning over rape allegations against him that he has repeatedly denied.
Assange said he fears being sent to Sweden to face trial because the country could extradite him to the United States, where he says might face a long prison sentence or even the death penalty for publishing hundreds of thousands of classified documents.
Ecuador's Foreign Ministry said in a statement late on Wednesday that a letter has been sent by the Ecuadoran Government to set up the meeting.
"In the coming weeks, a date will be established for the proceedings to be held at the Embassy of Ecuador in the United Kingdom," the statement read.
Prosecutors in Sweden have said they want to interview Assange in connection with a 2010 rape allegation against him.
"The prosecutor has requested permission to carry out an interrogation, so it is of course good for the investigation if it can be held," Karin Rosander, spokeswoman for the Swedish Prosecution Authority, adding that the exact date of the interview has not yet been pinned down.
She added that the questions will be asked by an Ecuadoran prosecutor, but said "Swedish prosecutor Ingrid Isgren and a police investigator will take part."
WikiLeaks Founder To be Questioned On Rape Claim At London Embassy. Let Swedish Govt question Assange. https://t.co/kSo544eZYA
— Peter Ro (@petesro) August 11, 2016
Assange's defence team in statement said they welcome the fact that moves "are finally under way to take Mr. Assange's statement."
The statement added that Assange himself had long sought the opportunity to testify in the case, but that "the Swedish prosecutor has refused to accept a statement by video conference, affidavit or other standard means."
Assange, 45, sought refuge in the Ecuadoran embassy in London in June 2012 after exhausting all his legal options in Britain against extradition to Sweden. Ecuador in the past has said it does not want to interfere with Sweden's rape investigation.
Ecuador's government has said it would support Assange's transfer if Stockholm could provide guarantees that he would not be sent to the United States for prosecution over WikiLeaks' release of 500,000 secret military files.
Assange, be careful. Do not let them move you to a "more secure" place. https://t.co/Km38z1MquR
— Wil (@Bloggasaurus) August 11, 2016
Authorities have said the statute of limitations for charges against Assange runs out in 2020.
The former computer hacker on Wednesday appealed a Stockholm district court's decision to maintain a European arrest warrant against him over the rape allegation.
The anti-secrecy campaigner walked into Ecuador's London embassy four years ago, as Britain prepared to send him to Stockholm, and has not left since.
Last month, a Swedish district court maintained a European arrest warrant against Assange, rejecting his lawyers' request to have it lifted.
But a UN Working Group on Arbitrary Detention in February ruled in a non-binding decision that Assange's confinement in the Ecuadoran embassy amounted to arbitrary detention by Sweden and Britain.
Both Britain and Sweden have angrily disputed the UN group's findings.
Assange has compared living inside the embassy – which has no garden but is in London's plush Knightsbridge district, near Harrods department store – to life on a space station.