SANTIAGO (Reuters) - Chile withdrew on Wednesday as the host of an APEC summit next month at which the United States and China had been expected to sign a deal to ease a trade war that has hurt the global economy, as raging street protests gripped the South American country.

The abrupt move - which came after weeks of riots over inequality in Chile that have left at least 18 people dead - plunged the Asia-Pacific Economic Cooperation meeting into disarray, with participating countries caught off-guard and no alternative venue lined up.

Chilean President Sebastian Pinera, fighting for his political survival, said he had taken the “painful” decision to cancel the summit, as well as the high-profile COP25 international gathering on climate change in December, to focus on restoring law and order and pushing through a new social plan.

“As president to all Chileans I must always put the problems and interests of Chileans, their needs, their desires and their hopes, first,” he said in a brief statement at the La Moneda presidential palace in Santiago.

The APEC summit was scheduled to bring together 20 world leaders on Nov. 16-17. U.S. President Donald Trump and his Chinese counterpart Xi Jinping had been due to sign an interim agreement to end the 15-month-old trade war.

The cancellation might deny the two leaders a chance to meet on neutral soil soon but the Trump administration said it still expects to sign the deal with China next month. A White House official told Reuters that Chile’s cancellation of the trade summit had caught the administration by surprise.

Violent riots have left large parts of Santiago shut down, with the metro transport system suffering nearly $400 million in damage. A total 7,000 people have been arrested and Chilean businesses hit with losses of around $1.4 billion.

The Chilean government said on Wednesday that the final of the Copa Libertadores, the region’s top soccer tournament, would still go ahead as planned at Santiago’s national stadium on Nov. 23 between Argentina’s River Plate and Brazilian club Flamengo.

CLIMATE CHANGE SUMMIT

The major United Nations COP25 climate summit had been due to take place in Chile between Dec. 2 and Dec. 13.

That summit would have brought delegates from around 190 nations to talks aimed at thrashing out details of how to reduce global emissions to meet the Paris climate agreement.

Climate change teen activist Greta Thunberg, who was traveling across the Americas to the event, said on Twitter: “My thoughts are with the people of Chile,” adding that she would now pause her voyage and await further information.

The U.N. is urgently seeking a new venue for the conference, but said it may need to be delayed.

Slideshow ( 29 images )

Chile’s environment minister, Carolina Schmidt, said several options were on the table, including the U.N. headquarters in New York and Geneva. She said three other countries had also expressed interest but did not name them.

Schmidt said Chile would retain presidency of the meeting.

The environment minister of Costa Rica, which hosted a smaller climate change meeting known as PreCOP25 earlier this month, said it looked very difficult to stage a replacement COP like Chile had planned.

Slideshow ( 29 images )

“Any way you look at it organizing a COP in Costa Rica is illusory, it’s impossible, beyond our capabilities, it’s out of the question,” Costa Rica’s Environment and Energy Minister Carlos Manuel Rodriguez said.

Chile’s withdrawal - the first time a nation has pulled out of hosting a major climate summit at such short notice - threw the process into confusion and dealt a further blow to Chile’s much-vaunted image as one of the most stable countries in Latin America.

“This has been a very difficult decision, a decision that causes us a lot of pain, because we fully understand the importance of APEC and COP25 for Chile and for the world,” Pinera said.

A foreign diplomat in Chile who asked not to be named characterized the reaction to the cancellation as “more sad than angry,” but said he and others breathed a collective sigh of relief as logistical and security concerns had mounted with the unrest in Santiago.

Pinera fired almost half his cabinet this week - including his finance, interior and economy ministers - in a bid to quell the protests, but to little effect.

With Pinera’s popularity at an all-time low, Chileans have been calling for new protests, while the U.N. has said it will send a team to investigate allegations of human rights abuses by security forces.

Jorge Heine, a former Chilean minister and now politics professor at the Pardee School of Global Studies at Boston University, said the effects of the decision on Chile’s international standing could be significant.

“Such summits cannot be rescheduled at will, as heads of state have their agendas full,” he said. “The credibility of Chile as a serious international actor and interlocutor has been compromised, and will not be easy to recover.”