MEXICO CITY — The president of Mexico said on Thursday that he was canceling his scheduled meeting with President Donald J. Trump in Washington next week, rejecting the visit after the new American leader ordered a border wall between the two nations.
The move by Mexico’s president, Enrique Peña Nieto, brings to a head the simmering tensions that have been building for months between the two leaders. After calling for dialogue in the face of Mr. Trump’s vows to build a wall, Mr. Peña Nieto ultimately bowed to public pressure in Mexico to respond more forcefully to his northern neighbor.
The decision to cancel the meeting was the result of a remarkable back-and-forth between the two sparring leaders, much of it delivered on Twitter.
On Wednesday, the new American president signed an executive order to beef up the nation’s deportation force and start construction on a new wall along the border.
Adding to the perceived insult was the timing of the order: It came on the first day of talks between top Mexican officials and their counterparts in Washington, and just days before the meeting between the two presidents.
Mr. Trump’s action was enough to prompt Mr. Peña Nieto to start discussing whether to scrap his plans to visit the White House, according to Mexican officials. In a video message delivered over Twitter on Wednesday night, Mr. Peña Nieto reiterated his commitment to protect the interests of Mexico and the Mexican people, and he chided the move in Washington to continue with the wall.
“I regret and condemn the United States’ decision to continue with the construction of a wall that, for years now, far from uniting us, divides us,” he said.
Then on Thursday morning, Mr. Trump fired back, warning that he might cancel the meeting himself if Mexico did not agree to pay for the wall.
Just before Mr. Trump fired off his Twitter post, the Mexican foreign minister and Mr. Trump’s Homeland Security secretary, John F. Kelly, were preparing to see each other for a scheduled 11:30 a.m. meeting.
According to a senior American official, the secretary had been briefed. The appropriate flags had been arranged by the protocol staff at the Department of Homeland Security. Then, just as American officials greeted the minister outside the department’s headquarters in Northwest Washington, the minister received word from Mexico that he was being pulled back, the official said. The meeting never happened.
By early afternoon, Mr. Trump said it was the United States that was being treated unfairly.
“We have agreed to cancel our planned meeting,” Mr. Trump said in a new conference Thursday afternoon. “Unless Mexico is going to treat the U.S. fairly, with respect, such a meeting would be fruitless, and I want to go a different route. We have no choice.”
In Mexico, Mr. Peña Nieto had little political room to maneuver. With Mr. Trump’s order to build the wall, the perceived insults Mexico had endured during the campaign had finally turned into action. Decades of friendly relations between the nations — on matters involving trade, security and migration — seemed to be unraveling.
Calls began to come in from across the political spectrum for Mr. Peña Nieto to cancel his visit, and to respond with greater fortitude to the perceived menace from President Trump. On Twitter, Mr. Trump’s action was referred to by politicians and historians as a “an offense to Mexico,” a “slap in the face” and a “monument to lies.”
Historians said that not since President Calvin Coolidge threatened to invade a “Soviet Mexico” had the United States so deeply antagonized the Mexican populace.
“It is an unprecedented moment for the bilateral relationship,” said Genaro Lozano, a professor at the Iberoamerican University in Mexico City. “In the 19th century, we fought a war with the U.S.; now we find ourselves in a low-intensity war, a commercial one over Nafta and an immigration war due to the measures he just announced.”