President Trump has warned China that it must respond “humanely” to the protests in Hong Kong if it wants a trade deal, for the first time suggesting that the United States would impose costs on Beijing if it launched a Tiananmen Square-style crackdown on the city. It’s about time. China is in a much weaker position in Hong Kong than many realize. It claims to be showing “restraint,” but the fact is if China could easily crush the protesters, at a cost acceptable to Beijing, it would have done so by now.

The situation China faces in Hong Kong is very different from the one in Tiananmen Square three decades ago. At Tiananmen, the protesters were gathered in a large public square like sitting ducks where they could be easily mowed down. In Hong Kong, protest tactics have been adopted specifically to avoid another Tiananmen. The protesters are “like water” flowing through a huge and crowded city. Demonstrations are organized on the fly, via social media, and take place in multiple locations simultaneously. If China cracks down in one place, the protesters can disperse and start again in a different location. Moreover, the Hong Kong protests are leaderless, which means there is no cadre of organizers who can be rounded up to break up the movement. If China arrests one group of leaders, others will simply rise up to take their places.

In Tiananmen, the clearing operation was conducted in the dark of night and out of sight of the media. A Hong Kong intervention would take place in the full glare of the international press corps and under the scrutiny of millions of cellphone cameras that would record every atrocity for the world to see. And the operation could last for months or even years.

In Hong Kong, the terrain favors the defenders. If the military moved in, it would face determined resistance. China wants to break popular support for the protests, but a crackdown would have the opposite effect. Think about the trouble the United States had rooting insurgents out in Iraqi cities; how much harder would it be in a modern city such as Hong Kong?

The one advantage China now enjoys compared with 30 years ago is technology. On the mainland, the regime is constructing an Orwellian surveillance state, with cameras and facial-recognition technology to track its citizens. The extent to which Beijing has wired Hong Kong is unknown, but protesters can still use technology to their advantage, communicating via encrypted messaging apps and social media. Shutting down their means of communication would also cripple Hong Kong’s financial sector, which depends on the free flow of information.

Finally, a military intervention would mean the end of Hong Kong, and that is something Beijing cannot afford. The mainland economy is slowing and might even be contracting. Trump is hammering China with tariffs. If President Xi Jinping cracks down, he will cause capital and talent to flee the city, which could kill the golden goose.

So, what should Trump do? He should warn Xi that if he launches a crackdown in Hong Kong, then the United States will repeal the Hong Kong Policy Act, under which we treat Hong Kong separately from China and give it better terms. That treatment rests on the idea that Hong Kong is a distinct entity, but if Beijing moves in and occupies the city, ending its autonomy under the “one country, two systems” principle, then the rationale for treating Hong Kong better disappears. (It’s worth noting that nearly 1,400 U.S. businesses operate in Hong Kong.)

Trump should also tell Xi that if he cracks down, the United States will welcome Hong Kongers as refugees. Hong Kong is the most economically vibrant city on Earth, filled with hard-working, creative, entrepreneurial people – precisely the kind Trump has said he wants coming into our country. If China does not want them, Trump should say, we’ll happily take all their entrepreneurial energy and creativity here in America.

Trump should make clear that the cost of military intervention will be capital flight, brain drain and the end of Hong Kong’s preferential trade status, as well as any hopes of a trade deal. China would face massive tariffs and international sanctions that could send its economy into full contraction – which could cause instability and protests on the mainland. A military operation, even if it succeeded, would be Pyrrhic victory.

China does not have the upper hand in this standoff; Trump does. He should use his leverage to save Hong Kong.

Washington Post columnist Marc A. Thiessen is a fellow at the American Enterprise Institute and former chief speechwriter for President George W. Bush.

Twitter: marcthiessen