When it first appeared, it looked like a floating city. For months in the summer of 2012, the ship just sat there – a hulking, confusing presence off the Pacific coast of Baja California Sur.

Florencio Aguilar was worried. A stranger in the waves was a threat. Like many others in the tiny fishing towns of San Juanico, Las Barrancas and others in north-west Mexico, Aguilar relies for his livelihood on the lobsters, octopus and abalone that thrive here. The pristine waters are also home to endangered sea turtles, a breeding ground for giant grey whales and a magnet for surfers, who flock here to ride one of the world’s longest waves.

Aguilar ticked off the possibilities: the enormous ship wasn’t one of the research vessels that edged along the Baja coast to survey the rich marine life, and it didn’t look like one of the big fishing ships that sometimes came to scoop up shrimp.

The news eventually filtered down to him from some fellow fishers. The ship belonged to the Florida-based Odyssey Marine Exploration, which had obtained a concession across a huge area of Mexican seabed to mine phosphate, a key ingredient in commercial fertilisers.

Aguilar was horrified. The project, which could see dredging happen for 50 years, overlapped directly with the fishing concession belonging to the Puerto Chale cooperative, an alliance he leads of more than 120 fishers whose families have lived off these waters for generations. “Constant dredging would finish marine life and all life in our fishing sector,” Aguilar says.

The discovery was just the beginning – the trigger for years of disruption as Aguilar and the cooperative fought against a mine they saw as an existential threat. There were angry public meetings, accusations of corruption, appeals to the Mexican president.

At last, six years later in 2018, Mexico’s government eventually rejected the mine because the potential environmental impacts would be too damaging. Aguilar and the community celebrated.

For once, their story seemed to buck the trend of mining corporations trampling the tiny communities that stand in their way.

But Odyssey had an ace up its sleeve.

In 2019, it sued Mexico. To do so, it used an obscure tool of international law called investor-state dispute settlement (ISDS), which allows companies to bypass domestic courts. Suddenly, the fate of this seabed mine mattered far beyond this desert-fringed coast. Odyssey’s lawsuit had opened a window into an opaque legal system, one with the power to fatally undermine the abilities of countries to protect their own environments – just as the world teeters on the edge of climate and biodiversity breakdown.

A spokesperson for Odyssey said it “took appropriate legal actions to defend itself from an extortion attempt”, and did not intend to “intimidate or dissuade opposition to the project”. Both Aguilar and Ibarra vigorously reject accusations of extortion, and although they were eventually told no lawsuit would be progressing, for Ibarra the stress caused him to all but abandon journalism for years.

But for a while, the ordeal seemed to have been worth it. Twice the Mexican government turned down the mining permit – once in 2016, and again, definitively, in 2018, saying the mine “sought to uninterruptedly dredge the seafloor” of a place “that constitutes a natural treasure and of utmost importance for Mexico and the world”.

“We felt very satisfied,” Aguilar says, but adds, “We knew it was just a rest, and not total victory.”