The United Nations announced on Sunday that Ecuador will reinstate fuel subsidies to end leftist riots that have engulfed its capital for weeks.

The riots forced Ecuadorian President Lenín Moreno to move the government out of the capital city of Quito. After talks with the indigenous groups allegedly behind the riots, lawmakers reached an accord that saw Moreno – elected as a socialist but governing since 2017 largely to the right of center – abandon several major economic reforms meant to embolden the nation’s financial state. The United Nations joined the Vatican in mediating the talks.

Seven people died during the Quito riots, and rioters held more than 50 members of the military hostage. Hundreds of demonstrators have been arrested and well over a thousand injured.

As previously reported, protests began this month against President Moreno’s “Decree 883,” which ended a decades-old government oil subsidy that paid a portion of fuel costs to keep prices low. In addition, Ecuador withdrew from the Organization of Petroleum-Exporting Countries (OPEC), which limits member nations’ oil production to keep prices high. Moreno contended that increasing oil output would force prices down naturally, saving the government money it spends on the subsidy while consumers would still pay relatively low prices.

After fuel prices initially skyrocketed, bus and taxi drivers directly affected took to the streets. The transportation workers rapidly found an agreement with Quito, but alleged “indigenous activists” continued to protest. Indigenous communities account for roughly a quarter of Ecuador’s overall populace.

President Moreno repeatedly pressed for talks with indigenous leadership, but the opposition refused all communication up until Sunday’s meeting. Following the settlement agreed upon, the fuel subsidies will be reinstated, and a commission – mediated by the same organizations – will be established to repair damaged relations with indigenous people of the Andean nation.

In its place, a new law will be written to help curb fuel smuggling and other exploitation of the subsidies. Government official Juan Sebastián Roldán characterized the result as a concession, rather than defeat. “Conceding is not losing,” he said. “Here we are all conceding.”

“With this agreement, the mobilizations … across Ecuador are terminated and we commit ourselves to restoring peace in the country,” said a joint statement released after the talks were concluded.