Whatever the ultimate outcome of Donald Trump's conflict with Mexico, one consequence is already clear. He has undermined one of the most impressive American foreign policy achievements of the last three decades.
Mexico used to be a reflexively anti-American country, radical and resentful toward its powerful neighbor to the north. But starting in the 1990s, through the careful efforts of leaders on both sides of the border, that changed.
Until Donald Trump came along.
For much of its modern history, Mexico almost defined itself in opposition to the United States. It saw itself as a developing country that was oppressed by its high-handed, imperialist neighbor. And this image did have some basis in reality. From the Mexican perspective, America's relations with it were characterized by exploitation and annexation.
After a failed attempt to purchase what is now California, Arizona, New Mexico and other Western states, President James Polk invaded Mexico and essentially seized this territory.
In 1853, the U.S. acquired even more Mexican land in the Gadsden Purchase.
In total, the U.S. got roughly half of Mexico's land.
After that, and well into the 20th century, Washington's approach toward Mexico was usually aimed at protecting the interests of large American corporations, especially its oil companies that had tried to operate in Mexico with minimal interference from local authorities.
All this bred a political climate of defiance and resistance toward Washington that made cross-border cooperation difficult on almost any issue. As Shannon O'Neil observes, Mexico was one of the few countries that rejected American assistance through John F. Kennedy's Alliance for Progress program.
Things turned in the 1990s.
The Cold War ended and the idea of a socialist country became less threatening to America. Mexico went through a series of economic crises in the 1980s and 1990s and desperately needed help. It began opening up its economy and political system.
American firms were doing more business in Mexico and wanted a stable trading partner. Washington began to recognize that the best solution to all the problems across the border —immigration, drugs, violence — was a prosperous, democratic Mexico.
Relations between Mexico and the United States soon transformed.
The old anti-Americanism faded into oblivion.
The two countries stepped up cooperation on almost all relevant issues, signing the North American Free Trade Agreement and working together on everything from water management to immigration to drugs.
Consider that the Mexican government allowed the United States to take custody of its most wanted criminal, Joaquín "El Chapo" Guzmán, and try him in a court in Brooklyn.
Despite all the scorn that Donald Trump has heaped on Mexico, its most radical and left-wing president in a generation, Andrés Manuel López Obrador, has responded like a grown-up, saying, "The Mexican government is a friend of the U.S. government."
AMLO, as the Mexican president is known, is himself Mexico's response to Donald Trump. It is difficult to tie his election entirely to Trump's anti-Mexican rhetoric, but note that his party won only 8.4% of the vote in 2015 and that he was polling at around just 25% in 2016 after Trump became the Republican presidential nominee.
As Trump's Mexico-bashing persisted into his own presidency, AMLO labeled him a "neofascist" and even published a book titled "Listen, Trump." Last July, AMLO won a staggering 53% of the presidential vote and his party won 37.5% of the legislative vote, double the showing of the next-highest performing party.
Mexico now has a radical socialist at its helm in no small measure thanks to the nasty and derisive rhetoric of Donald Trump.
But even AMLO recognizes that, as Mexico's president, he has to make nice with Washington. The relationship is lopsided, as it has always been. But the country feels freshly humiliated, and the reformers are in retreat.
As a former senior Mexican diplomat, Jorge Guajardo, wrote in Politico, "All our old suspicions are confirmed: The United States is not a friend. The United States is out to get us, again. We're back to where we were before NAFTA."
Guajardo points out that Mexico could stop cooperating on a host of issues that affect Americans. Mexicans see the drug trade, for example, as created by American demand, financed by American cash and fought with American guns.
And yet Mexican police die every month trying to stop this trade. The Mexican government has tried to stem migration to the U.S. from Central America and cooperates closely with the U.S. on this, even though the level has become unmanageable for both Mexican and American authorities.
Mexico is America's top trading partner by some measures, even outranking China and Canada. But this understates the interdependence between the two economies. One study estimated that 40% of what the U.S. imports from Mexico is American-made content, much higher than any other country.
The two peoples are now deeply intertwined economically, politically and culturally. The relationship between Mexico and the United States could be a unique example of cooperation under difficult conditions.
But that would require a different U.S. president.
Fareed Zakaria hosts CNN's "Fareed Zakaria GPS," and makes regular appearances on shows such as ABC's "This Week" and NBC's "Meet The Press." He has been an editor at large Time magazine since 2010, and spent 10 years overseeing Newsweek's foreign editions. He is a Washington Post (and internationally syndicated) columnist. He is author of "The Post-American World." For more of Fareed Zakaria's reports, Go Here Now.