On Jan. 26, Mexican President Enrique Peña Nieto canceled a planned trip to the United States to meet with President Trump. (Edgard Garrido/Reuters)

UNTIL A few days ago, the U.S.-Mexico relationship was a strong one that benefited both countries. In the first week of his term, President Trump seems determined to change that — and for no good reason.

After decades of economic integration, the United States and its southern neighbor have established a valuable trading relationship exchanging $1.4 billion in goods every day. Mexico is the second-largest foreign market for U.S.-made products. Trade and investment between the two nations create wealth for both nations, and for innumerable American companies, workers and consumers, all of whom would be harmed by a trade war. Moreover, Mexico has become a valuable partner in promoting liberal values, having institutionalized multi-party democracy and steadily increased economic freedoms within its borders. As it has matured into a middle-class nation, the flow of Mexicans north has reversed, with more returning home in recent years than migrating to the United States.

In deference to this mutually beneficial relationship, Mexican President Enrique Peña Nieto has strained against provocation to get along with Mr. Trump. He invited him to a meeting in Mexico City last year, to Mr. Trump’s political benefit and at Mr. Peña Nieto’s own political risk. He was planning a visit to Washington next week to look for constructive cooperation.

Then, boom. Mr. Trump planted a stick of dynamite under a structure that leaders of various parties in both nations have been carefully constructing for decades. And for what?

The president first announced this week that he intended to proceed with construction of an expensive and unnecessary border wall, fulfilling a campaign promise based on misunderstandings of both the extent of illegal immigration and the best way to deal with it. Then Mr. Trump revived his pledge that Mexico would finance its construction. The humiliation was too much to bear for Mr. Peña Nieto, who faced understandable political pressure at home. The Mexican president canceled a scheduled meeting with Mr. Trump.

At that point, wiser heads still could have defused and de-escalated. Instead, White House press secretary Sean Spicer announced that the president is considering a new tax on Mexican imports to pay for his gratuitous wall. Mr. Spicer, without providing many details, suggested the tax would raise some $10 billion a year. He later explained that this is just one of several options. Depending on its design, such an imposition could indeed hurt Mexico. But it also would likely act as a tax on American consumers of Mexican goods. American consumers, that is, would pay for the wall by paying higher prices for Mexican-grown tomatoes, Mexican-sewn clothing and Mexican-built cars.

U.S. officials should reach out and seek to repair the week’s damage. It took the United States nearly a decade to recover from the economic wreckage of the last recession. A wealth-destroying trade war with one of America’s closest partners would threaten that long-sought recovery.