Updated

The record-setting heat wave blamed in the deaths of at least 50 people has also killed thousands of dairy cows and other livestock, leaving farmers with piles of carcasses and creating a backup at factories that turn the dead animals into pet food.

A combination of sweltering temperatures, growth in the state's dominant $5 billion dairy industry and fewer plants to properly dispose of the animals have forced several counties to declare a state of emergency, allowing the dumping of dead livestock in landfills — something usually outlawed because of the health risks.

"But what can we do? We have to weigh the possible contamination to ground water versus piles of dead cows stinking and attracting flies," said Phil Larson, chairman of the Fresno County Board of Supervisors.

Fresno County, which reached 113 degrees in recent days, was one of the first to declare an emergency when a plant that handles the bulk of the region's dead animals broke down earlier this month. After the old carcasses began decomposing in the searing summer heat, county officials were forced to make the first such declaration in the county's history, Larson said.

"It wasn't any easy solution. It's not something we want to continue but we can't have piles of dead animals laying around," he said.

Dairy farmer Brian Pacheco said he sometimes waits days before a rendering plant will pick up his dead cows.

"And when they do come, they only take the ones that died that day," said Pacheco, who uses Baker Commodities, a rendering plant in Kerman. "I'm left with the old bodies."

Calls to Baker Commodities were not returned.

Pacheco has spent thousands of dollars to build shade structures and install misters and fans in his barns to keep his cows cool. He says that has translated into higher milk production and he loses fewer cattle than other area farmers, but he still sees 15-20 cows die each year from the heat, and this year it could be more.

San Joaquin County, which also has declared an emergency, estimated that its dairy farms were losing a total of 120 cows per day from the heat.

Individual dairy farmers could lose about 2 percent of their herd this year, according to industry experts.

Hundreds of thousands of chickens and turkeys — totaling more than 1 million pounds — have also died. But dairy farmers struggle with animals that don't sweat and aren't getting much respite at night.

The state Environmental Protection Agency issued guidelines earlier this month for farmers stuck with dead livestock. They can have them hauled to a landfill by licensed handlers or compost their animals on their property by burying them in manure, which is common in other states.

Usually, farmers in California take their dead animals to rendering plants, but many have closed amid odor complaints from growing communities nearby, accusations by environmentalists and lawsuits stemming from improper disposal.

In 1999, two Modesto Tallow Co. officials pleaded guilty to discharging animal parts into the Tuolumne River, a violation of the federal Clean Water Act. In 2003, the company paid a $114,508 settlement in a case brought by the Solano County district attorney, who charged the plant with spilling blood and animal parts on roads.

Modesto Tallow was forced to close its doors in December as part of a settlement in a lawsuit brought by the San Joaquin Valley Air Pollution Control District that claimed the plant repeatedly violated air pollution standards.

The closing left the plant in Kerman the only one to handle the dead animals from the Stanislaus County line down to Bakersfield, posing a problem to a region where huge dairy farms are growing.

"They're just sitting out there in the sun, drawing flies," Pacheco said.