The executives of a global mining corporation assumed it would be easy to get their way in Cabañas, a rural region of northern El Salvador. They were wrong.

What they wanted was to extract the rich veins of gold buried near the Lempa River, the water source for more than half of El Salvador’s 6.2 million people. Instead, local farmers and others came together to fight the project over concerns that the toxic chemicals used in gold mining would poison their water. In time, they won over a strong majority of the public and rallied the Catholic Church, small businesses, and labor and environmental groups to successfully pressure the national government to oppose mining.

Then the company struck back. Pacific Rim (a Canadian firm later bought by Australia-based Oceana Gold) filed a lawsuit against the government of El Salvador in 2009, demanding $250 million in compensation for the loss of profits they’d expected to make from their mining project there. This is a staggering sum for a cash-strapped country, the equivalent of 40 percent of El Salvador’s entire public health budget in 2015.

The mining company demanded $250 million, the equivalent of 40% of El Salvador’s health budget.

After seven years of legal blackmail aimed at getting the Salvadoran government to back down and allow the mining to go ahead, an international tribunal that is part of the World Bank Group finally dismissed the lawsuit on October 14. They also ordered the company to pay $8 million of the government’s legal expenses. For the Salvadoran anti-mining activists who have paid a painfully high price for their resistance, it was a measure of justice.

One of those activists is Miguel Angel Rivera. In June 2009, his brother Marcelo, a prominent cultural and environmental leader who opposed the mine, was tortured and assassinated. While questions remain, many activists believe that pro-mining forces — including local politicians who stood to benefit if Pacific Rim started mining — are ultimately responsible for his murder.

We first met Miguel in October 2009, when he and four others active in El Salvador’s National Roundtable against Mining traveled to Washington to receive the Institute for Policy Studies’ Letelier-Moffitt Human Rights Award, a prize that brought international recognition to this struggle. Then when we made our first trip to Cabañas in 2011 to learn more about the mining resistance, Miguel greeted us at the airport.

As he drove us through mountainous roads to the office of his employer, ADES (the Social and Economic Development Association), we asked him how he’d come to opposing mining. He pointed to our water bottle and said “Just like you, water is our priority.”

In the years since, we’ve met hundreds of people in Cabañas who have risked their lives in the struggle against mining under the banner of “Water for Life.” Miguel Rivera and his fellow roundtable members kept up resistance by constantly mobilizing the neighboring communities of Cabañas, frequently traveling to the capital to lobby policymakers and rally their allies, and keeping up the drumbeat through the press, including community radio. They also traveled internationally to spread the story of their struggle and build solidarity across borders.

Their perseverance was truly remarkable in a country where nearly a third of the population lives in poverty and activists face constant threats.

Their perseverance was truly remarkable in a country where nearly a third of the population is living under the national poverty line and where activists faced constant threats. The same year Marcelo Rivera was murdered, two other anti-mining activists, Ramiro Rivera and Dora Alicia Recenos, were also assassinated. And then in 2011, Juan Francisco Durán Ayala, a volunteer with the Cabañas Environmental Committee, was also murdered. And yet in the face of severe risk and economic hardship, people on the ground stood up and said “we would love jobs but not if they come at the cost of water.”

On the day the tribunal ruled against the mining company, Miguel thanked all his international allies. “For the people who have suffered all kinds of indignities and had to overcome all kinds of difficulties and adverse situations to achieve this result, today reassures us that the ideals to which Marcelo Rivera, Ramiro Rivera, and Dora Alicia Recenos gave their lives are worthy. It fills us with joy and also gives us reason to believe that our struggle in defense of life is just.”

Of course, the struggle is not completely over. The international allies that came together in solidarity with the anti-mining movement in El Salvador are committed to pressing the mining firm to pay what they owe and leave El Salvador for good so that efforts to build viable alternatives to mining can take root.

At the same time, we’re drawing from this experiences to redouble our efforts on the trade front. We must stop the Trans-Pacific Partnership and other trade and investment agreements that give corporations the power to sue governments over actions that infringe on their profits. Although the ruling went the right way in the end, the people of El Salvador should’ve never had to go through this seven-year legal battle in the first place. Such “investor rights” are the most extreme example of excessive power granted to corporations through trade agreements.

And so while we continue to support our heroes in El Salvador, we must also work for a whole new approach to international trade and investment that respects democracy and puts people and planet first.