Just after 6am, Victor Funez fills a three-gallon plastic pitcher with water from a tap in the cemetery, balances it on his head and trudges home, where his wife waits to soak maize kernels so she can make tortillas for breakfast.

Funez, 38, stops briefly to help his daughter with some homework before heading back to the cemetery with the pink urn. This load fills large plastic milk and juice bottles used for drinking throughout the day.

The tap is the family’s only source of water, so Funez makes the journey along the dusty dirt road 15 to 20 times each day.

“My husband’s job is to fetch the water so I can do the housework. It’s like this every day, all day,” said Bianca Lopez, 46. “We can live without electricity – we have candles and lamps – but water, that’s essential.”

Facebook Twitter Pinterest Victor fills up the a large pitcher with potable water at a cemetery tap. Photograph: Juan Carlos/The Guardian

La Estación is a makeshift community of 59 households along disused railway tracks that cut across Nejapa – a semi-urban municipality on the northern outskirts of El Salvador’s capital.

This tiny Central American state is one of the most murderous in the world, plagued by warring gang factions and security forces who shoot to kill. Relentless bloodshed and chronic unemployment have driven wave after wave of migration as Salvadorans seek a better life.

But in recent years, widespread water shortages are increasingly helping fuel unrest and forced displacement.

“Marginalized communities struggle day to day to get access to enough water. It’s not a question that this could one day cause social conflict – it already is … the whole country is close to crisis,” said Silvia de Larios, the former director of ecosystems and wildlife at the ministry of environment and natural resources (known by its Spanish acronym, Marn).

Facebook Twitter Pinterest A family uses a plastic container to store water. Nejapa has a water crisis, as many communities do not have access to potable water and those who do tend to get water only a few hours or days a week. Photograph: Juan Carlos/The Guardian

El Salvador is the most densely populated country in Central America. It also has the region’s lowest water reserves, which are depleting fast thanks to the climate crisis, pollution and unchecked commercial exploitation.

According to one study, El Salvador will run out of water within 80 years unless radical action is taken to improve the way the country manages its dwindling water supplies.

As in just about every aspect of life in El Salvador, the water problem is only exacerbated by corporate interests, corruption and the country’s vicious street gangs.

Local women have long used the banks of the San Antonio River as an open-air laundry. But the laundry spot lies within Barrio 18 territory, whereas La Estación is controlled by the rival MS-13 gang – and crossing gang boundaries can get you killed.

Nejapa has one of the highest murder rates in the country, with 71 homicides per 100,000 habitants in 2018, according to research by Elizabeth G Kennedy, a migration and violence scholar.

López’s only income comes from washing her neighbour’s clothes, but she endures the hardship of the tap and pitchers rather than crossing the frontline. “It would be much easier at the river, but it’s not worth my life.”

Facebook Twitter Pinterest A local washes clothes at the San Antonio River, which is drying out due to climate change. The river has a long history of being used to wash clothes, bathe and even drink water. Photograph: Juan Carlos/The Guardian

For some, there’s no choice but to take the risk.

At 10.30am, Elena Fuente, 46 and daughter-in-law Jocelyn Álvarez, 23, rush towards a waiting rickshaw with plastic bowls jam-packed with freshly washed clothes balanced on their heads. Álvarez loses her balance and falls, scraping her knees badly.

She’s new to the river laundry, as their MS-13-controlled neighbourhood previously had running water every night, but there’s been not a drop for the past 22 days, and no one knows why.

“We risk the gangs because we’ve no other choice – we’d run out of clean clothes,” said Fuente. None of the women would dream of bringing a man to the spot, she added. “That would cause a problem.”

Years of drought has prompted water rationing in urban and rural areas across the country. Yet much is wasted: most rainwater is lost due to widespread deforestation and eroded river basins; once in the system, 48% of water is lost through leaks.

Sources are already running dry: the Nejapa aquifer provides 40% of the water used by the overcrowded capital, but the water level has shrunk by 20% in the past five years alone.

Meanwhile, a lush forest, known as the lungs of Nejapa, is being chopped down to make way for gated housing developments with private underground wells.

Nejapa’s biggest industrial water guzzlers and alleged polluters – the local Coca-Cola bottling company and sugar cane plantations – have been unaffected by rationing.

In the fields behind the Coca-Cola factory, murky, foul-smelling water can be seen pumping into a stream. AB InBev, the world’s largest brewer which controls the bottling company, did not respond to specific questions about the pollution, but said it was committed to sustainability and conservation.

At least 90% of El Salvador’s surface water is contaminated by untreated sewage, agricultural and industrial waste, according to studies by Marn.

“There are no clear rules, no sanctions, no monitoring, and big business uses these legal vacuums to exploit water as a product for profit. It’s the poorest who suffer most,” said De Larios.

Facebook Twitter Pinterest Men place seeds to harvest corn right next to the Nejapa waste dump, which contaminates the areas around the community. Photograph: Juan Carlos/The Guardian

The suffering is stark in nearby Joya Galana, a campesino canton of 53 families with a bird’s-eye view – and smell – of the country’s biggest open rubbish dump, which has polluted every river and underground water source for several miles.

Joya’s water supply is piped in from another community, but was recently cut off for three months after thousands of dollars were stolen from a maintenance fund and a waterhole fund dried up.

The supply is back for now, but the situation is precarious. “Today we have water, tomorrow who knows?” said Sonia Guardado, 40, who, like many others, is considering leaving the country. “Our water supply isn’t secure. We need solution, or else we’ll have to leave.”

Amid the escalating water crisis, a network of grassroots groups, environmentalists and the Catholic church convinced lawmakers to make history in 2017 by banning metal mining – a major cause of pollution.

But politicians have so far refused to create an independent regulatory system, which campaigners argue would put human consumption and sustainability above corporate interests.

Andres McKinley, a water and mining scholar from the Central American University (UCA), said: “This is a huge political issue; we must change who controls water. That’s the war we’re in.”

La Estación was built on disused state land in 2015 by families unable to afford anything else. Four years later, it’s still battling for running water, a sewage system and land titles (the community is technically illegal).

Facebook Twitter Pinterest A family walks along the train rails which are no longer used at La Estación, a makeshift community which was settled along an abandoned railway. Photograph: Juan Carlos/The Guardian

It’s a constant grind to get water – and to get rid of it – and both challenges fuel health problems and tensions between neighbours.

At 2pm, thunder rolls and rain crashes down on the metal sheet roofs.

Some neighbours rush outside to uncover tall barrels to collect the precious drops, but the rain also floods shallow ditches along the unpaved roads. As the storm subsides, clouds of mosquitoes appear above the dirty puddles.

Last year, health inspectors blamed the community’s contraband water supplies and makeshift drainage system for a spike in mosquito-borne dengue and chikungunya.

Neighbours in adjacent communities with running water stopped selling it to La Estación under threat of fines; others put up barbed wire fences to stop them laying hoses. So the inhabitants of La Estación have had to be creative.

Health and water officials clock off at 4pm. At about 4.01, Esmeralda Cerritos, 29 , a local union activist, unspools a long hose and attaches it to a tap in a the house of a neighbour who charges her $2 a month.

She dangles the other end of the hose into the pila, a deep trough next to the cement sink in the yard, and gathers dozens of containers and bottles, each specifically identified in the precise lexicon of water storage: balde, pinchanga, barril, tambor, cántaro, juacal, pinchel and garrofón.

Facebook Twitter Pinterest Esmeralda shows the drawings of how to build a home sewage system, which is what the Salvadoran water department is requiring for residents to have if they wish to be considered to have a potable water system in their home. Photograph: Juan Carlos/The Guardian

It takes three hours to fill the receptacles, which will last the family three or four days. “We’ve been trying to get running water for four years, but there’s always another hurdle,” she said.

A community meeting is held to discuss the latest challenge: the health ministry will only authorize running water for households with septic toilets, which cost about $500. This either means the poorest neighbours will be left without water, or the entire community will be forced to wait another a year until a sewage plant is built.

The community votes to wait, in order to avoid further divisions: in 2015, a mayoral candidate promised people running water in exchange for $250 and their votes.

Fifteen households agreed: they have water (though no legal permits), and they refuse to share with neighbours. Cerritos spoke out against the deal, but received death threats.

With gang members on either side of the division, Cerritos backed off.

“The cycle of violence begins when the state abandons communities by not providing fundamental human rights like water, education, health and jobs – which end up being the fertile ground in which gangs and violence grows,” said Jeanne Rikkers, a violence prevention expert with the NGO Cristosal.

“But the fix is only ever about the violence, never the root causes. As water become increasingly critical, gangs will likely become involved in community conflicts as the state is absent.”