For more than 100 years, most of what gets flushed down Mexico City's toilets has resurfaced two hours to the north in the rivers and reservoirs of the rural Mezquital Valley. A massive new water treatment plant is about to change this.

But rather than welcoming the prospect of cleaner water, angry farmers are demanding the government honor an 1895 presidential decree granting them the right to the capital's untreated sewage, which they see as fertilizer-rich, if foul, irrigation water.

It's a standoff that pits public health concerns — not just for valley residents but for the Mexicans elsewhere who eat the crops — against fears that family farms will go under if they lose access to the raw sewage after the $530 million Atotonilco plant in Hidalgo state, billed as the largest of its kind in Latin America, goes online.

"My grandparents went with a pickaxe and a shovel opening the (irrigation) canals," said Teresa Alvarez, a 69-year-old grandmother who farms alfalfa, corn and wheat in the town of Tepatepec. "So it's not fair that all of a sudden they are taking away the waters, and we are going to fight."

The capital's waste was hardly seen as a boon when it first began arriving in the poor, semi-arid valley traditionally inhabited by the indigenous Otomi people. But over the decades, the "aguas negras," or "black waters," transformed the region into one of Mexico's most productive breadbaskets. Today, a vast network of low-tech, gravity-based canals irrigates more than 90,000 hectares (220,000 acres).

According to Fernando Sanchez, a 37-year-old opponent of the plant, corn fields here yield an average of 15 tons per hectare (6 tons per acre) and some produce as much as 18 tons (7.3 tons). Once they switch to treated water, he predicts that could fall by nearly half.

Costs are also likely to rise as farmers switch to fertilizers and agrochemicals, which entail their own environmental risks, to make up for the loss of the sewage. Without government support, they say agriculture in the region could become unsustainable and spur migration to the United States and elsewhere in Mexico.

Farmers have been meeting with elected officials and the National Water Commission, known by its Spanish initials Conagua, to present their concerns. But suspicions run deep, especially since water has long been a scarce resource in central Mexico.

So far officials have been willing to listen, Sanchez said, but "what there is not, is an openness to find a solution for us."

Conagua declined multiple requests for comment. In brochures promoting the plant, which is in its testing phase and expected to come online later this year, the commission called the use of untreated sewage for farming "a public health problem."

It argued the plant will preserve many of the nutrients in the water, improve conditions for the valley's 700,000 residents, gradually reduce pollution in the region's waterways and allow the cultivation of currently banned crops.

"Hopefully we will see fewer diseases and there could be less sickness among humans," said Silvino Garcia, 62, who grows barley alongside the Endho reservoir in the valley. But the farmer fears the plant will lower farm output, adding "there are pros and cons."

The Mezquital Valley is a green-and-brown patchwork of small plots, most of them a single hectare (2.5 acres) or less, traced by narrow canals. From a distance the landscape looks bucolic; up close, in some parts, plastic bags and bottles choke the canals and foam billows several feet above the water. The sewage smell is faint in most places except near the Endho reservoir, where a fetid stench permeates homes and makes residents ashamed to invite outsiders to visit.

During wastewater flood irrigation, bacteria can contaminate low-lying crops and later invade consumers' digestive tracts if the produce is not disinfected or cooked. The World Health Organization says risks to consumers include increased rates of cholera, typhoid, diarrhea and roundworm infections.

Most of the crops grown in the valley are low risk to humans: Alfalfa, for example, is used for animal feed, and corn grows several feet above the water in protective husks.

But there are also plots of prohibited, ground-hugging produce such as cauliflower, broccoli and cilantro, all of which flow from the valley to Mexico City's Central de Abastos wholesale market and from there to street stalls, taco stands and dinner tables.

Efrain Gonzalez, who represents farmers from five towns around the city of Tula, has reservations about the plant but acknowledges there's something absurd about "waiting for 10,000 residents of the capital go to the bathroom so that I can fertilize my field."

Farmers who irrigate with wastewater also face health risks, including roundworm and other parasite infections, according to the WHO. Their children are more vulnerable to diarrheal disease and salmonella.

But most of the Mezquital farmers downplay the risks, claiming that generations of families have not suffered. In fact they often wash their hands in the brown water before settling down to eat lunch in the fields.

Manuel Ortega, an 89-year-old farmer, said he was raised on leafy greens, beans and zucchini grown here.

"It never gave me the runs," he added with a laugh.

Christina Siebe, a geologist at the National Autonomous University of Mexico who has spent decades researching farming in the Mezquital Valley, said while there are obvious problems with wastewater farming, it can reduce demand for scarce freshwater resources, keep organic waste from ending up in rivers and oceans, and recycle nitrogen, phosphorus and organic material.

She says it's not clear a treatment plant like Atotonilco is worth the cost.

"There are simpler and cheaper methods to reduce the risks. ... How you manage your land, what type of crops you produce and what hygiene practices you as a farmer use," Siebe said.

Another point of contention with locals is that Atotonilco lacks the capacity to treat all the capital's wastewater, with the part that currently fertilizes the fields getting cleaned and what's left over going into the valley's already-polluted waterways.

When the much-delayed plant is up and running, the portion of treated sewage produced by the metropolis of 20 million-plus people will rise to 57 percent, compared with 11 percent when construction began in 2010.

Mezquital farmers want to see no drop in the amount of water they receive or how much organic material it contains. If they don't get that, they vow to surround and occupy the plant.

"They are trampling on a historic right," said Juan de Dios, a farmer from Mixquiahuala.