Mr. Xi doesn’t have that luxury anymore. He has solidified control over ever more of Chinese political and social life and the economy. This year, he removed term limits, setting himself up to be president for life if he chooses. While the trade war with the United States provides a handy scapegoat, public blame for a prolonged downturn could ultimately fall on him. Already the government has ordered that bad economic news be censored.

Mr. Xi now faces more of a diplomatic balancing act. The Chinese authorities have detained two Canadian nationals, in apparent retaliation for Canada’s arrest of a top Chinese telecommunications executive at the behest of Washington. But Chinese officials have struck a quieter tone with the Trump administration over the arrest and separate allegations of hacking, since a sharp escalation in the trade war could seriously damage the economy.

President Trump already senses an advantage. “China just announced that their economy is growing much slower than anticipated because of our Trade War with them,” he tweeted on Friday. (The slowdown began before the imposition of the tariffs, but they have hurt both business and consumer confidence and will probably pinch even more if they linger or intensify.)

Thanks to the government’s tight hold on important industries and the financial sector, it has more levers to pull in case of a downturn than practically any other country. Beijing’s efforts in the spring to wean the economy off debt, a major cause of the slowdown, are now being reversed.

Already, China has ramped up the sort of government-led spending that bailed out its economy in the past. At Xuzhou Construction Machinery Group, a state-owned giant that supplies many highway and rail builders, sales have jumped 50 percent from a year ago, said Wang Min, the company’s chairman.

Regulators have also ordered banks to lend more to private businesses. Ministers have promised to compensate businesses for not laying off workers. Environmental controls are being less stringently enforced, making it easier for polluting factories to stay open.

Some economists believe growth will improve by the middle of next year. And China so far appears to have avoided huge job losses like those it saw during the global financial crisis.