Spain’s pigs outnumber the human population for the first time, according to figures released by the country’s environment ministry, which reveal there are now 50 million pigs, 3.5 -million more than humans

The figures show an increase of about 9 million animals since 2013 and there are growing concerns about the environmental impact of an industry that produced more than 4m tonnes of pork products and generated €6bn (£5.4bn) last year.

The soaring pig population is a key factor in making livestock the fourth-largest generator of greenhouse gas emissions after transport, electricity generation and industry.

Pig farming also consumes vast quantities of water in a country frequently affected by drought. With each pig consuming 15 litres a day, altogether the industry uses more water than the cities of Zaragoza, Seville and Alicante combined. Nitrates from the animals’ waste products are also beginning to contaminate ground water, environmentalists say.

Pork production has also been hit by a series of food safety scandals. This year a police investigation was triggered when a customer returned a worm-riddled ham to a branch of the French supermarket chain Carrefour. Police uncovered a network of unscrupulous suppliers and more than 50 tonnes of ham that was destined for the incinerator but instead has been relabelled with new sell-by dates.

It was another blow to an industry that has a reputation for fraudulent practices, especially in the production of the prized denomination of jamón ibérico de bellota, which can retail at hundreds of euros a kilo.

To qualify the ham must come from thoroughbred blackfoot pigs, which spend the last few months of their lives roaming free through oak woodland known as dehesa, feeding on acorns. The meat must then be cured for a minimum of 36 months.

It is a slow process and demand outstrips supply. Francisco Espárrago, who produces jamón ibérico de bellota in Extremadura in western Spain, said there were not enough resources to enforce regulations.

“When you don’t control an industry in which traditionally there’s a lot of fraud, because there’s a lot of demand but not a lot of product, this is what happens,” he said. “For example, some animals graze in the dehesa but instead of living on acorns for the last three months of their lives they’re given animal feed, but the inspector sees the pigs in the woods and so they receive the denomination.”

There have also been strikes at several abattoirs over poor working conditions. Many workers in the sector are recent immigrants and a significant number are Muslims who do not eat pork.

Spaniards consume about 21kg of pork each a year and the nation’s love of pig dates back thousands of years. Roman commentators wrote admiringly about Spanish ham, and pigs were given special protection under the Goths who ruled after the Romans departed.

When Muslims conquered much of the Iberian peninsula, the pig became a symbol of Christian resistance. Under the Inquisition, eating pork in public became a test of faith for Jews and Muslims who had been forcibly converted to Christianity.

