Julian Assange’s legal team is preparing to defend the WikiLeaks publisher against a possible U.S. extradition request in anticipation of Ecuador ejecting him from its London embassy at any moment.

Ecuadorean President Lenin Moreno confirmed Friday that his government is working with British officials toward brokering Mr. Assange’s exit from the embassy, potentially putting the Australian-born activist on the path to face criminal charges abroad related to his role running WikiLeaks.

“If they do remove his protection, we will go to the courts to protect him,” said Jennifer Robinson, an attorney for Mr. Assange, The Times of London reported Saturday.

“We are preparing to defend him in the British courts and will fight extradition to the U.S,” Mr. Robinson told the newspaper. “We don’t have any indication of time frame. This is a very serious situation, one that we are very concerned about. It’s a matter for Ecuador, the U.K., the U.S. and Australia.”

Mr. Assange, 47, entered Ecuador’s embassy over six years ago while under house arrest in relation to a rape investigation pursued at the time by Swedish prosecutors. He was seeking protection in lieu of surrendering to authorities and potentially being extradited to the U.S., convicted and executed for releasing hundreds of thousands of classified U.S. documents through WikiLeaks, the anti-secrecy website he launched in 2006.

Mr. Assange subsequently received asylum from Mr. Moreno’s predecessor, Rafael Correa, and Sweden dropped its rape investigation last year. British authorities said he breached his bail conditions by entering the embassy and will arrest him upon exiting, at which point the Trump administration could unseal charges against him and officially seek his extradition.

The U.S. Department of Justice has not publicly announced charges against Mr. Assange, but Attorney General Jeff Sessions has called his arrest a priority.

“I have never been in favor of Mr. Assange’s activity,” Mr. Moreno said Friday in Madrid. “I have never agreed with the interventions in people’s private emails in order to obtain information, however valuable it may be, to bring out certain undesirable acts of governments or people, not in that way.”

Addressing the impasse, Mr. Moreno said any arrangement concerning Mr. Assange’s fate will involve whether prosecutors will seek the death penalty.

“The only thing we want is a guarantee that his life will not be in danger,” said Mr. Moreno.

Eric H. Holder Jr., the attorney general when the Justice Department began investigating WikiLeaks, has said prosecutors were considering charging Mr. Assange with espionage, a capital crime. Chelsea Manning, an Army private convicted of supplying WikiLeaks with classified documents, was ultimately convicted by a court-martial in 2013 of espionage and other charges and sentenced to 35 years in a military prison. President Obama commuted the bulk of her sentence, and she was released last year.