WikiLeaks founder Julian Assange speaks from the balcony of the Ecuadorean Embassy in London. File picture: Kirsty Wigglesworth/AP

Quito - A lawyer for Julian Assange says an agreement announced by Ecuador's president to end his stay in the South American country's London embassy is not acceptable, the Telegraph reported on Thursday.

President Lenin Moreno earlier said an agreement had been reached with the British government and that the WikiLeaks founder could not be extradited to face the death penalty.

"The suggestion that as long as the death penalty is off the table, Mr Assange need not fear persecution is obviously wrong," Assange's lawyer Barry Pollack told the Telegraph.

"Since such charges appear to have been brought against Mr Assange in the United States, Ecuador should continue to provide him asylum," he added.

Moreno earlier said in a radio interview that "the way is prepared for Assange to leave the embassy" without giving many details.

"He has to serve a short sentence for not facing the British authorities. It will not be long," he said.

Wikileaks meanwhile took to Twitter on Thursday to accuse Moreno of attempting to "divert attention" from a New York Times report alleging the Ecuadorian president attempted to "illegally sell Assange to the US for debt relief."

Assange fled to the Ecuadorian embassy in 2012 to avoid arrest and extradition to Sweden on allegations of rape. However, his relations with Quito have since soured and Ecuador has this year ramped up its efforts to end the activist's stay.

The Swedish judiciary has stopped its investigation into the rape allegations, but the British authorities have said they will still arrest the activist when he leaves the embassy because he violated his bail conditions by fleeing.

Assange says if he leaves the embassy he fears he may be extradited to the United States, where he faces trial for treason for publishing controversial documents from the wars in Afghanistan and Iraq.