The aisles at Lotte Mart in Beijing's Wangjing district were strangely quiet last week. A few elderly shoppers pushed trolleys; shop assistants tidied the supermarket's shelves. Customers have been scarce since "something happened" a few weeks ago, said one cashier. That event was a deal signed on Feb. 28 by Lotte, a South Korean firm, allowing the U.S. to build an anti-missile system on land the company owns in South Korea.

China's government has responded by encouraging an outpouring of public anger directed not just at Lotte, whose shops in China are now being boycotted, but almost anything South Korean.

Nationalism is a familiar weapon in China's diplomatic armory. The last time the government made such a sustained effort to whip it up was in 2012, shortly before Xi Jinping came to power, when officials encouraged protests against Japan's nationalization of islands it controls in the East China Sea that are also claimed by China. South Korea is not a usual target. But China is furious at its decision to deploy the missile-defense system, known as THAAD. The U.S. says THAAD will help defend the peninsula against North Korea. China says the U.S. will use the system's powerful radar to "snoop" on its missiles too, reducing their potency as a deterrent.

In recent weeks, state media have been publishing daily attacks on South Korea's "erroneous decision." The Global Times, a jingoistic newspaper in Beijing, has encouraged Chinese consumers to "become the main force in teaching Seoul a lesson." It said they should "make it hurt."

Censors often try to rein in online discussion when it threatens to boil over into real-world protests. But they are allowing netizens to vent rage at South Korea. One group of online nationalists called on "all patriots to unite and show South Korea what we can do." A famous beauty blogger exhorted the 2.7 million followers of her microblog to boycott goods from the country and not to travel to it. A patriotic pop song has been played more than 3.5 million times since its release on March 8. It includes the lyrics: "Chinese sons and daughters must stand up; everybody, stop buying Lotte; make them get out of China fast."

Lotte owns about 100 supermarkets in China, as well as other businesses. They have been badly hit. The company has been subjected to sudden and simultaneous tax and safety inspections. Ten of its shops have been shut for violating fire codes. The website of Lotte Duty Free crashed after a cyberattack. Several e-commerce sites have stopped selling Lotte's goods and some suppliers have ceased doing business with the company.

The tourism industry has also been disrupted. South Korea is normally a popular destination, but many Chinese travel agencies have reduced or halted trips there (seemingly on the government's orders). Others have been warning customers that it is dangerous to go. Airlines from both countries have been reducing services. On March 11, about 3,000 Chinese tourists refused to leave their ship when it docked at the South Korean resort of Jeju, apparently in protest against THAAD.

The Chinese government may be relishing the opportunity that THAAD has provided to push back against what officials sometimes call South Korea's "cultural infiltration": its popular music ("K-pop") and television dramas have huge Chinese followings. No South Korean artist has been granted approval to perform in China since September. Appearances by a famous South Korean soprano, a concert pianist and a popular boy-band, EXO, have all been canceled. Companies and TV stations have been urged to "fine-tune" performances by South Koreans: a K-pop star had his face blurred on a reality show. Chinese streaming platforms have removed some South Korean programs. South Korean celebrities now find it hard to renew advertising contracts in China.

But China's leaders worry about any popular movement that does not involve the Communist Party — even one that is led by nationalists who profess to be on the government's side. Xi, despite his own nationalist rhetoric, has been wary of letting passions flare too high.