A Chilean environmental court has upheld a complaint by indigenous communities in the country’s northern Atacama Desert about the use of water by SQM, the world’s second-largest producer of lithium.

The decision by the First Environmental Court in the nearby city of Antofagasta calls into jeopardy SQM’s $400m plan to expand its lithium carbonate production plant to feed appetite for the ultralight battery metal.

Water has become a key sticking point for the expansion plans of both SQM and top competitor Albemarle, both of which operate in the salt flats of the Atacama, the world’s driest desert, which supplies more than one-third of the global supply of lithium, a key ingredient in the batteries that power electric vehicles.

Soaring lithium demand has raised questions about whether Chile’s arid northern desert can support current and future levels of lithium production along with the needs of sprawling nearby copper mines, a booming tourism industry and indigenous communities.

The court ruled that a compliance plan presented by SQM in response to a multi-year investigation by Chile’s SMA environmental regulator that found the miner had overdrawn lithium-rich brine was “insufficient”.

The plan included a new online system to monitor extraction rates of brine, which holds lithium in suspension, and the shutting down of one of its freshwater wells.

The court said its decision was based on a “precautionary principle”, taking into account the “particular fragility” of the Atacama’s ecosystem and the “high level of scientific uncertainty” about the behaviour of its water table. It said SQM had no way of proving that the measures it had proposed were capable of “containing and reducing or eliminating the negative effects generated by the breaches of the company”.

“We must protect sensitive ecosystems even more when they constitute the ancestral habitat of our native peoples whom the State of Chile is obliged to protect,” the court president, Mauricio Oviedo, said in a statement.

The complaint was brought by indigenous people living in surrounding communities of Peine and Camar, and the Indigenous Advisory Council of Atacameno People.

The SMA must now resume its sanctioning of SQM for the original infractions, the court said, which could involve fines of more than $3m, the closure of its operations or revocation of its environmental permits.

Neither SQM nor the SMA could immediately be reached for comment.