The stream that leads into the San Sebastian River in the poor and tiny Central American country of El Salvador runs bright yellow, not for the gold in the mine nearby but for the chemical byproducts which leach into the water. That stream is emblematic in a fight between an Australian mining company and the El Salvador government, over whether there should be gold mining in the country.

If El Salvador wins this fight, it will preserve a bipartisan policy on mining, a country’s right to make policy generally, and to protect its main water supply in particular.

If it loses, then a foreign mining company will be able to ride roughshod over the country’s democratic process and prosecute a financial claim that could send its government broke.

The yellow stream which symbolises what can happen with gold mining is a consequence of “acid mine drainage”. This stream in question flows into the San Sebastian River, where it has killed all aquatic life, and then into the sea, where it causes further environmental damage.

Nearby San Sebastian village suffers a high rate of disease linked to arsenic poisoning as a result of this pollution. El Salvador’s government believes that, if the Australian mining company’s attempt to impose a new gold mine is successful, there could be even more devastating consequences for the country’s limited drinkable water supply.

The Australian-listed, Melbourne headquartered company OceanaGold is suing El Salvador in a US-based court for more than $300 million - almost half the government’s annual budget – over the government’s refusal to grant the gold mining permit.

OceanaGold is claiming that under the US-central America free trade agreement, it has a “right” to compel mining or be compensated for loss of profits. In response, the company will today be handed a petition signed by 200,000 opponents to its attempt to force gold mining in El Salvador.

OceanaGold focused its attention on gold mining in El Salvador when it acquired the Canadian company Pacific Rim in November 2013, with the intention of developing Pacific Rim’s El Dorado gold exploration site in El Salvador’s north. OceanaGold knew at the time it acquired Pacific Rim that the El Salvador government had refused to grant a mining permit for the El Dorado site, yet it proceeded with the acquisition none the less.

The El Salvador government says that the original application to mine did not meet environmental safety standards and that the proposed mine poses risks to the country’s already limited water supplies. OceanaGold denies the risks, even though gold mining is notorious for polluting waterways with arsenic, mercury and other toxic metals.

Just 2% of El Salvador’s water is determined by its government to be of good quality and what were clean ground water supplies have already been degraded by early exploration at the El Dorado site. Further water pollution, especially of the country’s main watershed in the region of the proposed mine, would have disastrous consequences for El Salvador’s poor and densely packed population.

The El Dorado gold mine has been the site of protests, a result of which has been the murder of 10 people, with others receiving death threats. Opposition to gold mining became a critical political issue in El Salvador’s 2009 elections, with both major parties backing a moratorium on metals mining in the country.

It is not yet clear whether the court will recognize OceanaGold’s status as a US-based company, necessary for the claim to proceed. But with other potential mining claims against El Salvador’s government waiting in the wings, the court’s decision will determine whether El Salvador can choose to protect its environment or whether foreign corporations can determine a country’s clean water policy.