President Trump with Chinese President Xi Jinping at the Group of 20 summit in Osaka, Japan. (Susan Walsh/AP)

THE STANDOFF between Hong Kong’s pro-democracy movement and China’s Communist rulers continues to escalate. Last Sunday, organizers estimated that 1.7 million people — or nearly a quarter of Hong Kong’s total population — marched through pouring rain to demonstrate their continuing support for the territory’s autonomy and to demand greater freedom. Authorities in Beijing responded with more hints of armed intervention, even as militarized police forces conspicuously drilled in the neighboring city of Shenzhen.

The threat of a mainland invasion might be bluffing by the regime of Chinese President Xi Jinping, which surely realizes that it would incur huge economic costs and shred its pretensions to global leadership. Nevertheless, it must be taken as a real possibility by Western democracies, which supported the territory’s return to Chinese sovereignty two decades ago on the basis of Beijing’s guarantee that its independent legal system and rights of free speech and assembly would be maintained for 50 years.

This weekend’s summit of the Group of Seven industrial democracies offers an opportunity for those governments, including the United States, to send Mr. Xi a clear message: If he chooses to crush Hong Kong’s democracy movement, there will be far-reaching consequences for China’s political and economic relations with the West. The G-7 leaders should make clear that they will not hesitate to adopt punishing sanctions, including the immediate revocation of Hong Kong’s special economic status, which facilitates flows of trade and investment to the mainland.

Such a declaration is needed because, until now, the West’s response to the Hong Kong crisis has been weak. Official statements, such as one issued last week by the European Union and Canada and another by the State Department, have mostly stuck to generic diplomatic calls for “restraint” and “deescalation” and “dialogue.” While supporting Hong Kong’s “fundamental freedoms,” neither the E.U.-Canada statement nor the State Department’s explicitly backed the mass protest movement or its entirely reasonable demands.

Worst of all has been the performance of President Trump, who has repeatedly made statements siding with Mr. Xi. In July, he declared that the Communist ruler had handled the protests “very responsibly” because “he has allowed that to go on for a long time.” A couple of weeks later, he called the demonstrations “riots” and mused that China might “want to stop that” before flashing a green light: “But that’s between Hong Kong and that’s between China, because Hong Kong is a part of China.”

Last week, stung by criticism of this blatant abdication, Mr. Trump bemoaned that “many are blaming me” before weakly expressing his “hope it works out for everybody.” He later claimed, ludicrously, that Mr. Xi could end the crisis in 15 minutes if he negotiated with the protesters. Last Sunday, Mr. Trump finally said it would be “very hard” to conclude a U.S.-China trade deal if there were a crackdown in Hong Kong, but he disassociated himself from such a response: “I’m the president, but that’s a little beyond me because . . . I think there would be tremendous political sentiment not to do something.”

Mr. Trump’s stance may encourage Mr. Xi to believe he will pay little price in the West if he orders a crackdown. That’s why G-7 leaders ought to prevail on the U.S. president this weekend to join them in dispelling that impression. They cannot directly defend Hong Kong or its people if China elects to use force. But they can do far more than they have so far to deter Mr. Xi.