Late Friday evening, a Washington-based tribunal threw out Pacific Rim Mining’s claims under the Central American Free Trade Agreement (CAFTA), but agreed to hear claims filed under El Salvador’s investment law. According to the Salvadoran National Roundtable against Metal Mining, the decision underscores why the tiny Central American country should withdraw from foreign tribunals and pass a law to prohibit metal mining in order to relieve itself of these sorts of threats. While details of the decision continue to be analyzed, it is clear that its continuation will be costly for all: company, state and, most of all, the Salvadoran people.

Pacific Rim began exploration in the rural department of Cabañas, El Salvador in 2002. In 2004, the company began applying for permits to start mining. According to company testimony before the International Center for the Settlement of Investment Disputes (ICSID), instead of ensuring that it had fulfilled all requirements to obtain the permits, Pacific Rim worked its high-level contacts to try to obtain project approval.

Meanwile, opposition among local communities arose over concerns that exploration activity was affecting water supplies and that this would worsen if a mine were put into operation. Over the course of a few years, the local opposition went national and the national roundtable was formed. It swayed public opinion against metal mining, given the existence of not just one, but several dozen possible mining projects in Salvador’s highlands and that the tiny, densely populated country is largely reliant on a single, already overtaxed, watershed.

When the company failed to get the go ahead for its project, it reincorporated its Cayman Islands subsidiary in Nevada and issued a notice of intent to sue El Salvador for at least $77 million under the U.S.-Central America Free Trade Agreement (CAFTA). It concurrently filed a claim under El Salvador’s investment law, which also allows disputes with foreign companies to be settled at ICSID in Washington.

In other words, rather than play by the rules in El Salvador and respect local communities that were calling for it to leave, the company decided to roll the dice and try mining for compensation in the U.S.

The lawsuit has been and will continue to be costly. To date, El Salvador has had to spend at least $5 million of public funds in legal fees. Five million dollars could provide one year worth of adult literacy classes for 140,000 people in El Salvador or feed 60,570 families in temporary housing for a full two weeks during a natural disaster. One would presume that the small junior mining company has paid out a similar amount and one wonders how long its few remaining shareholders will hang on for the risky ride. Moving ahead, one Salvadoran news outlet estimates that the expensive dispute could take another 12 to 18 months to resolve.

Most worrisome, the suit also seems to be having a chill effect on El Salvador passing into law a ban on metal mining to protect the country’s water supplies. Since 2008, large-scale mining activities have been suspended according to a Presidential promise. But efforts at legal reform have been protracted.

A demonstration took place Saturday outside Pacific Rim Mining’s Vancouver office as part of the Council of Canadian’s Shout Out Against Mining Injustice to tell the company that it should just drop its suit and leave El Salvador once and for all.