Demonstrations in Hong Kong continue and their outcome remains unknown. A key part of this struggle is a global media offensive by Beijing that seeks to win friends, defuse opposition and divide the enemy. This effort offers important and revealing insights into how the Chinese government will deal with future challenges to its authority and its interests.

Protests broke out in Hong Kong in the spring, but they grew into mass demonstrations two months ago, triggered by a bill submitted to the legislature that would allow persons accused of crimes to be extradited from the territory to the mainland. Millions of people took to the streets; in one recent demonstration, it is estimated that 1.7 million people — almost a quarter of Hong Kong’s population — joined the protests, despite condemnations by both the Hong Kong and Beijing governments, the arrests of hundreds of people and an increasingly violent police response.

The scale of the protests surprised the leadership in both Hong Kong and Beijing, prompting the suspension of the legislation. Emboldened by their success, the demonstrators continue to call for change, however. Now, they have five demands: permanent withdrawal of the extradition bill; amnesty for all who were arrested; an inquiry into police actions; the resignation of Hong Kong’s chief executive, Carrie Lam; and democratic reforms that would liberalize elections for that position.

Beijing could accept the first four demands; the last one is not possible. If the protesters do not acknowledge that truth, this will end badly. Beijing is already laying a foundation for action through a media campaign to shape opinion about what is going on and how to interpret what it will do. It has three objectives: to rally opinion in China against the protesters; to divide the movement in Hong Kong; and to inoculate the Chinese public against any “democratic contagion” from Hong Kong.

Chinese sources have charged that the protests in Hong Kong are the product of Western “black hands,” with a Foreign Ministry spokesperson saying that “they are somehow the work of the U.S.,” although there is no evidence to prove the point. The protests have also been denounced as “terrorist-like actions.” State media have provided a distorted view of the news, focusing on incidents that involved injury to police officers and amplified the chaos that has been created in Hong Kong. In some cases, fake news was spread, with media reporting incidents that have been discredited elsewhere.

Chinese officials are pushing an ugly narrative about what is transpiring, and condemning all who demand respect for the protesters’ fundamental rights such as freedom of speech and assembly, or who insist that China respect the terms of the 1997 accord that returned Hong Kong to the mainland. This first half of that narrative is aimed at domestic Chinese audiences, appealing to nationalism and attempting to ensure that they harbor no similar ambitions; the latter message targets foreign governments and other supporters of the protests.

On another front, Beijing has created hundreds of fake social media accounts to shape opinion. Twitter announced that it had uncovered a “significant state-backed information operation” related to the Hong Kong protests. It cut off nearly 1,000 accounts after determining that they “were deliberately and specifically attempting to sow political discord in Hong Kong, including undermining the legitimacy and political positions of the protest movement on the ground.” Meanwhile, Facebook said that it was removing five accounts, seven pages and three groups involved in disinformation about the Hong Kong protests. Its investigation revealed “links to individuals associated with the Chinese government.”

China is taking a page from Russian efforts to influence American public opinion during the 2016 presidential election. Beijing has had practice of its own, however, having used social media to shape the outcome of elections in Taiwan. Other countries, such as Iran, appear to be using the same plan. Similar projects can be expected in Taiwan as it begins its next presidential campaign.

Thus far, Japan has been largely immune to foreign attempts to manipulate public opinion, but that is sure to change. As social media warriors acquire skills and experience, they will see Japan as an important target and a challenge to overcome. This country must prepare. There is no simple way to inoculate against such manipulation, however. Social media consumers have to acquire literacy and competency that allow them to distinguish between real and fake news. Social media platforms must be vigilant about attempts to influence domestic conversations. They must be quick to root out fake accounts or identify and block campaigns to shape opinion. It is a daunting assignment, but it is doable. Japan, and other democracies, must begin preparing now for the assaults that are sure to come.