Over the objections of economists, small business owners and former advisers, President Trump has chosen to prosecute a trade war with China. He’s invoked U.S. laws that give him sweeping authority to restrict imports without requiring congressional consent. He’s imposed duties on about $250 billion of Chinese goods and is signaling his intention to more than double the scope to cover all goods imported from China. And he may tighten the screws ever further after that.

That these measures are costly to U.S. consumers, manufacturers and farmers has not altered the president’s course. That they violate international trade rules doesn’t bother him in the slightest. That Beijing has been kept off-balance and struggling to make sense of Trump’s unorthodox tactics reassures him that he is winning.

The president’s decision to throw down the gauntlet with China reflects something deeper than merely the behavior of an impetuous blowhard looking for a fight. Trump is aiming to alter the course of history. While it would be less unsettling if that task were left to someone who possesses at least a vague sense of history, the point is that Trump’s hardline approach to China is less an abrupt policy pivot than it is the culmination of years of bipartisan hand-wringing in Washington over the question of how to respond to China’s rise.

With some good reason, over the past decade, U.S. policymakers from across the political spectrum have grown increasingly skeptical of China’s commitment to the global trading system and wary of the country’s ambitions. Trump may be the proximate cause of the trade war, but for years China has been daring the United States to start one. Beijing’s discriminatory indigenous innovation policies, forced technology transfers, apparent complicity in abetting other forms of intellectual property theft, market-distorting industrial policies, inconsistent treatment of foreign companies, and other transgressions have antagonized Washington.

Undoubtedly, many of the allegations against China are overwrought or fallacious. In all likelihood, the sum total of the adverse effects of Beijing’s trade policy transgressions are not orders of magnitude worse than the sum total of U.S. trade policy transgressions. But it is perceptions that matter and, frankly, under President Xi’s leadership, the Chinese government has exacerbated rather than assuaged growing concerns in America.

Whoever’s been managing Beijing’s public relations has failed to maintain balance between the messages meant for their domestic and foreign audiences. There has been too much triumphalism about China’s resurgence, too much emphasis on the inevitability of China leapfrogging the United States to the technological fore, too much brash talk about China “borrowing” Western innovations to get there, too little evidence of China being a “responsible stakeholder” and too few demonstrable assurances that China remains committed to a peaceful rise. Messages that make Chinese audiences proud ruffle feathers in Washington.

Meanwhile, Beijing’s increasingly illiberal domestic policies, including greater religious and political repression, an ongoing expansion of the surveillance state, reinforcement and extension of the Great Firewall of China, and other forms of crackdowns on speech and expression — all happening amid Xi Jinping’s coronation as China’s president for life — have eroded the credibility of the argument that engagement will make China more liberal, more democratic, more like us.

Embracing, encouraging and enabling China when it was a poor country struggling to recover from years of brutal policy mistakes, whose leaders came to recognize the imperative of widespread market reforms, was one thing. But continuing on the same trajectory with a much richer country that is led by an increasingly autocratic government pursing strategic objectives that, if met, might come at the U.S.’ expense, is something quite different. It is certainly a concern that cannot be dismissed simply by pointing out that tariffs are taxes on our own people and businesses. While trade wars are costly, stating so does nothing to answer the question of how the United States should respond optimally to the manner in which China is rising.

In his 2017 book Destined for War, Harvard political scientist Graham Allison cites the ancient Greek historian Thucydides, who wrote: “It was the rise of Athens and the fear that instilled in Sparta that made war inevitable.” The dynamic of a rising power challenging an incumbent hegemon has played out many times over the 2,500 years since the Peloponnesian War. The rising power with its expectations of greater influence over international affairs and its demand for commensurate respect presents a strategic dilemma to the incumbent, who can accommodate, adjust and hope for the best, or take action before it’s too late to frustrate the challenger’s rise. Too often throughout history, the response to this dilemma has precipitated war.

Amid a growing chorus of warnings that China is nipping at America’s heels and time is running out to respond strategically, Trump has responded. The incumbent has chosen to try to flatten the trajectory of China’s rise by depriving it of the economic oxygen it will need to surpass the United States.

Trump is closing off U.S. markets to Chinese goods, while he works to compel U.S. allies — by threatening tariffs on their automobiles and inserting provisions in trade agreements — to do the same. In the administration’s view, the United States is taking the lead to fix a problem that afflicts our allies as well, so they should get with the program. Soon, U.S. and other Western investment parked in Chinese manufacturing operations that export to North America and Europe will begin to dry up because that model of supply chain production — with China at its core — will have been made redundant.

Ever since the “contain vs. engage” debate reemerged during the George H. W. Bush administration in the wake of Tiananmen Square in 1989, there has been a vocal and determined camp of American China hawks warning that engagement would only strengthen an inevitable adversary. Those views took a back seat, as the decision to engage commercially — and as deeply as possible — became U.S. policy.

For most of the next two decades, China adopted economic reforms, U.S. and global engagement expanded, hundreds of millions of Chinese were lifted out of poverty, the world’s largest middle class emerged, U.S. consumers and businesses gained widespread access to low-priced goods and China rapidly ascended the ranks to become the world’s largest manufacturer and second largest economy. There were inevitable frictions in the process, but U.S. trade laws, bilateral dialogues, and WTO dispute settlement were available to manage those strains. The contain and isolate voices in the China debate remained muted. Accommodation remained the policy.

Then the Great Recession hit and perceptions changed. China had arrived and was intimating that it viewed the United States as a waning power, as she set her sights on becoming the world’s technologically preeminent economy by any means necessary. Over the ensuing decade, there has been a noticeable migration of U.S. policymakers from the “accommodate and engage” end of the China policy spectrum to the more hawkish “contain and isolate” end.

Today one is hard-pressed to find more than a few members of Congress who would oppose aggressive U.S. measures to frustrate China’s technology ambitions or who do not view Chinese economic policies with deep skepticism. This past summer, the Foreign Investment Risk Review Modernization Act (FIRRMA), which relaxes the conditions and expands the scope for U.S. government intervention to block Chinese acquisitions of U.S. technology companies and access to U.S. technology through other channels, passed in the Senate by a vote of 85-to-10 and in the House by a margin of 400-to‑2.

Although her tactics may have differed, a President Hillary Clinton would have faced the same strategic dilemma and likely would have made a similar choice to confront China. It is simply where the U.S.-China relationship has taken us. There is no longer a political upside to continuing to accommodate China, and very little political downside to getting tough.

For those who abhor trade restrictions and who rightfully worry about the economic and opportunity costs that will beset a bifurcated global economy, it’s past time to develop arguments beyond moaning about the effects of tariffs on businesses and consumers. Trade wars, like real wars, are costly. But people are willing to sacrifice — at least up to a point — when they believe a cause is worth fighting for. The question is: How do we get the optimal outcome at the lowest cost? Doing nothing — instead of imposing tariffs — in response to China’s policies would have cost nothing in the short run. But if the concerns raised by China’s policies are legitimate, doing nothing to fix them now will cost more to fix over time — if they remain fixable at all.

This is not to excuse Trump’s approach to China, but to explain it. It is an approach that risks economic calamity and worse. But it’s also an approach that doesn’t deviate too far from the mainstream and may prove less costly than if Trump were to stay the course and continue to tolerate and accommodate. Some people present the problem in exaggerated terms and as though the United States never transgresses. Others pretend the problem doesn’t exist. The truth lies somewhere in between.

In 12 of the 16 historical “rising-power-versus-incumbent-hegemon” cases evaluated in Graham Allison’s Destined for War, the outcome was, indeed, war. In the four cases where the powers managed to avoid “Thucydides’ Trap,” the moral suasion and legal parameters of international rules and institutions featured prominently. So, too, did the capacity of the rivals to distinguish their strategic needs from their wants and to insist only on securing the former. To prioritize everything is to prioritize nothing, as Allison concludes.

If history is to judge Trump’s trade war in a favorable light, it must lead to a long term strategic equilibrium — a new understanding with a new set of rules and incentives — where Washington and Beijing see commercial engagement between Americans and Chinese not only as mutually enriching, but as economically optimal and an imperative for peace.