Less than two years ago Chinese officials warned that the spread of a deadly and highly transmissible virus was threatening the country's economic stability and its people's prosperity.

Curbing the outbreak was a "major political task" said Hu Chunhua, a deputy prime minister and member of the Communist Party's ruling Politburo. He said his instructions on how to tame the disease were to be treated as a "military-style order".

Hu was speaking in August 2019, months before COVID-19 was identified. He was referring to another virus — the one that causes African swine fever. The disease is harmless to humans but deadly to the pigs that provide one of China's most important sources of food and a livelihood for tens of millions of the country's farmers.

In contrast with its remarkably effective battle against COVID-19, China has failed to conquer swine fever.

With one of the world's highest rates of pork consumption, China is normally home to about half of global pig stocks. But its porcine population has been severely affected by a swine fever panzootic (the animal equivalent of a pandemic) that began in 2018 and has threatened herds in many countries.

It has wrought havoc in the supply of China's staple meat, creating wild swings in the prices of pork and feed grains. Officials say that in 2019 it resulted in the loss of between one-fifth and one-third of the country's pigs from disease or culling.

That year swine fever cost the industry between $50 billion and $120 billion, according to the Asian Development Bank. In 2020 stocks recovered swiftly. But by late last year infections began to rise again.

In July, officials said there had been 11 outbreaks of the disease since the beginning of 2021, twice the number reported in the whole of the previous year. The new hot spots are widely separated, with some in the far northeast and others in the southwest.

Officials hint at the scale of the problem. Efforts to control it, they say, are "complicated." But pig-industry insiders say the government is painting too rosy a picture. "It's out of control," says one. Only a small share of infections are being reported, say executives at several Chinese swine firms.

One reason for China's secretiveness is that admitting the scale of the problem would raise questions about whether it should do what other countries have done to end it. During this panzootic and earlier outbreaks, some have culled large portions of their pig stock and closely monitored the destruction of carcasses.

Were this to happen in China it could cause years-long disruption in pork supplies on a scale too large to be alleviated by imports or government stockpiles. Shortages and high prices of pork could infuriate the public.

During the COVID-19 pandemic, China mobilized millions of party members to enforce lockdowns and help ensure the supply of essentials to affected people. It devoted far less energy to controlling swine fever, which would also require considerable vigilance and manpower.

About 40% of China's pork is produced by small family farms. Many have neither the money nor the know-how to raise pigs hygienically. They often feed hogs with household swill that contains infected meat and can easily spread the disease unless it is superheated first, which it rarely is. When cases of swine fever are reported near their farms, owners often sell their animals before they show symptoms.

As with the coronavirus pandemic, vaccination offers hope. Several countries are trying to develop one. America is cooperating with Vietnam, conducting field tests of a vaccine among infected herds there. China has said little about its own efforts.