Spain will host U.N. climate change talks in December after Chile withdrew, the United Nations said on Friday, a last-minute switch that raises big logistical challenges and has left activist Greta Thunberg stranded on the wrong side of the Atlantic.

The U.N. climate change talks, known formally as COP25, will be held from Dec. 2 to 13 as originally planned, but in Madrid — over 10,000 km (6,000 miles) away from Santiago.

Chile’s government on Wednesday announced it was withdrawing as host of both the December climate summit and the Asia-Pacific Economic Cooperation summit scheduled this month after two weeks of riots over inequality in the South American country left at least 18 people dead.

“Excellent news: Madrid will host the Climate Summit on December 2-13,” Spain’s acting Prime Minister Pedro Sanchez wrote on Twitter. “Spain is working from now on to guarantee the organization of the #COP25.”

Alexander Saier, a spokesman for the United Nations Framework Convention on Climate Change, said that the Spanish government would help expedite the issuance of visas and set up an agency to help organize the travel and accommodation of the roughly 25,000 people expected to attend.

“It is more important that the conference takes place, politically. I think it would have been not a good sign if the conference would have been canceled or postponed,” Saier said.

Madrid Mayor Jose Luis Martinez-Almeida called his city’s role hosting the conference a “good opportunity to show our commitment in the fight against pollution and show that we are prepared to welcome its 25,000 attendees.”

The conference comes amid calls for swift action from environmental groups and climate protesters, with recent scientific reports urging sweeping measures to keep global temperatures from rising by more than 1.5 degrees C.

Teenage climate change activist Greta Thunberg, who has led a high-profile global climate strike movement to focus attention on global warming, said the change of venue for the summit had stranded her on the wrong side of the Atlantic.

Thunberg, currently in Los Angeles, traveled to the United States by yacht from Europe and had planned to continue her trip to Santiago for the climate talks carbon-free.

“It turns out I’ve traveled half around the world, the wrong way:),” she wrote on Twitter. “Now I need to find a way to cross the Atlantic in November… If anyone could help me find transport I would be so grateful.”

Spanish Environment Minister Teresa Ribera on Friday offered to help her get to Madrid for the summit.

“Dear Greta, it would be great to have you here in #Madrid. You’ve made a long journey and help all of us to raise concern, open minds and enhance action. We would love to help you to cross the Atlantic back. Willing to get in contact to make it possible,” she said on Twitter, without giving details.

Chile will continue to assume the presidency of the climate talks while in Madrid. The so-called Conference of the Parties conference is aimed at fleshing out details of the implementation of the Paris Climate Agreement of 2015.

News that the summit will be held in Madrid comes at a tense time for Spanish politics, with pro-independence protests that have sometimes turned violent in the northeastern region of Catalonia, and the second parliamentary election this year set for Nov. 10.

Sanchez, whose popularity has been declining, may hope the conference will burnish his international and environment credentials.

It is not the first time recently that Madrid has stepped in at the last minute as replacement host for a event that was supposed to take place in South America.

In December last year, the Spanish capital hosted the Copa Libertadores soccer final instead of Buenos Aires, after violence led the original match to be called off.