Correction: An earlier version of this story incorrectly said bovine carcasses were floating past Shanghai. The story has been corrected.

BEIJING — The dead pigs keep bobbing up in Shanghai’s rivers.

When hundreds of porcine bodies started surfacing this weekend in rivers upstream from the city, it prompted only mild shock, showing perhaps how routine safety scares about food and water have become in China.

But worries turned to panic late Tuesday, when authorities revealed that the number of pigs pulled out of waterways had climbed in the course of three days to an astonishing 5,916.

Shanghai officials pleaded for calm and insisted drinking water for Shanghai’s 23 million residents is still safe. They said there is no disease epidemic at cause. Instead they pointed their fingers at farmers in a nearby city of Jiaxing, who they say are dumping pigs who die in the course of their farming into the Huangpu River instead of properly burying or incinerating them. Local authorities near the pig farms in turn blamed their recent spike in dead pigs on colder temperatures, which they say caused the pigs to freeze or catch colds.

But all such explanations have been met online with equal measures of skepticism, anger and gallows humor, with some residents joking that perhaps the pigs killed themselves after refusing to breathe China’s increasingly polluted air or in protest of being force fed hormones and antibiotics.

Shanghai’s agricultural department said a sample from some of the dead pigs showed the presence of porcine circovirus, which poses no safety risk for humans, according to them.

But that has not deterred rampant concerns among residents as endless photos of bloated carcasses circulate online. More than 200 municipal boats have been mobilized to patrol the river, fishing lingering bodies out of the water, authorities said.

Water and air pollution have increasingly sparked public anger in China. And the pigs — one of the most ubiquitous staples of Chinese cuisine — are just the latest food to attract public scrutiny. Recent years and months have seen their share of tainted milk scandals, antibiotic-filled chicken, glowing meats, toxic liquor and recycled cooking oil.