Jerry Nivens lives in a trailer in Caballo, N.M., 165 miles south of Albuquerque. A bulky Texas transplant who chain-smokes American Spirits, Nivens cares as deeply for his mesquite-speckled patch of ground as any rural New Mexican. He enjoys driving into the mountains, where he used to while away afternoons panning for gold. He goes fishing Lone Star-style -- in reservoirs, not rivers.

On the sunny May day I met him, he spilled out of his GMC Jimmy sporting a National Rifle Association ballcap and Magnum P.I.-style sunglasses. He wore brown corduroy pants hung from suspenders with a matching jacket over a plaid shirt. A giant Marlboro belt buckle completed the ensemble. As we drove around, Nivens marveled at artesian pools supporting desert wildlife, exclaimed as a squadron of baby quail crossed our path, and wondered over underground rivers that run to the nearby Rio Grande. Retired from the refrigeration business, he earns money from an invention of his used for water purification. He spends much of his time alone. "I'm kind of an old hermit," he says.

Which, in a way, was why I had come -- to learn how and why this loner became the driving force behind a movement that brought the state's mega-dairies to heel. The dairy industry is New Mexico's largest agricultural sector and an influential lobbying force. Although the state Environment Department has long worked with dairies to reduce pollution, change has been slow: Almost 60 percent of the state's dairies have polluted groundwater with manure runoff, yet not one has begun the required cleanup.

Now, thanks largely to the pressure brought to bear by Nivens, his allies, and an Environment Department employee named Bill Olson, New Mexico has passed some of the most progressive dairy-related water regulations in the West.

Citizens have campaigned against dairy pollution in Idaho, Washington and California. Yet despite grassroots support for tighter controls, industry has largely succeeded in slowing or even loosening regulations. New Mexico's new rules may inspire other states to take the responsibility for limiting factory-farm pollution into their own hands, activists say.

In early 2007, "there was a rumor in one of our local newspapers here about some dairy trying to come down close to Caballo," Nivens explains as we drive to a sandy wash called Percha Creek. At first, he paid little attention, but then curiosity finally sent him exploring a tangle of dirt roads until he found a sign announcing ParaSol dairy's intention to build a 2,000-cow facility. It was right next to the creek, which becomes a raging torrent when it rains. There were houses nearby, too, and the Rio Grande, a drinking water and irrigation source already polluted by E. coli, was just two miles downstream.

To Nivens, it looked like a disaster in the making: Flash floods could flush manure from the dairy into Percha Creek, polluting the shallow groundwater and eventually the Rio Grande, threatening the drinking water of nearby residents and possibly contaminating the lettuce, chiles and pecans growing downstream.

Nivens went first to a local diner to share his fears with neighbors, and then to a nearby chile-processing plant. A woman there asked if a petition might stop the dairy. " 'I don't know,' " he recalls saying, " 'but I'll go home and make some.'

"That's how it all started."

The modern Western dairy, more factory than farm, was invented in Los Angeles County, Calif., by Dutch dairymen after World War I. Newly arrived from a land-scarce country, they brought the idea of keeping cows in a small space and importing their feed from elsewhere. This made it possible to become a successful dairyman in the arid West, which generally lacks good pasture.

As L.A. County boomed, so did the dairies. But sprawl pushed them out, first into the Chino Valley and neighboring San Bernardino County, and later, in the 1980s and 1990s, north into the San Joaquin Valley or out of the state entirely. California is still the number-one milk-producing state in the country, but Idaho is now number three, Texas seventh, New Mexico ninth, and Washington tenth.

With each move, the dairies grew. They sold land at suburban development prices and bought other parcels at agricultural cut rates, using the extra cash to add more cows. Changes in U.S. milk-pricing policy propelled their growth. Beginning with the Reagan administration, the government began setting milk prices based on the price of cheese traded on the Chicago Mercantile Exchange, so prices fluctuated more than before. Dairymen hedged against price drops by buying more cows and producing more milk. Their fixed costs stayed relatively constant, and they had more milk to sell as a cushion against low prices. When neighboring dairies went under, surviving ones bought up their cows. In 1970, there were almost 650,000 dairies in the United States. Today, there are only 62,500; almost 50 percent of U.S. milk now comes from dairies with more than 1,000 cows. New Mexico, whose dairies average 2,000 cows each, has the largest mean herd size in the nation.

As dairies added cows, the cows added manure. That manure -- 145 pounds of mixed solids and liquid per cow per day -- is usually flushed into a holding pond, or manure lagoon. Dairy owners often spray manure water onto cornfields as fertilizer and separate out the solids for compost. In theory, using waste to grow feed makes a dairy a closed-loop system.

In practice, the loop leaks. Farmers have more manure than crops to apply it to. Manure liquid can ooze from lagoons into groundwater, carrying nitrates, sulfate and chloride, along with remnant antibiotics and dangerous bacteria such as E. coli, salmonella, listeria and campylobacter.

"A lot of people still think of a dairy farm as black-and-white cows on a green hillside somewhere. And we still have that, but that's not (how) the majority of milk (is) produced anymore," says Mark Stephenson, director of dairy policy analysis at the University of Wisconsin's college of agriculture.