Tentative plans for Mexican President Enrique Peña Nieto to make his first visit to the White House to meet with President Donald Trump were scuttled this past week after a testy call between the two ended in an impasse over Trump’s promised border wall, according to U.S. and Mexican officials.

Peña Nieto was eyeing an official trip to Washington this month or in early March but called off the plan after Trump would not agree to publicly affirm Mexico’s position that it would not fund construction of a border wall that the Mexican people widely consider offensive, said the officials, who spoke on the condition of anonymity.

Speaking by phone Tuesday, Peña Nieto and Trump devoted much of their 50-minute conversation to the wall, and neither man budged.

One Mexican official said Trump “lost his temper.” But U.S. officials described him instead as being frustrated and exasperated, saying Trump believed it was unreasonable for Peña Nieto to expect him to back off his crowd-pleasing campaign promise of forcing Mexico to pay for the wall.

Both accounts confirm it was Peña Nieto’s desire to avoid public embarrassment — and Trump’s unwillingness to provide that assurance — that proved to be the deal-breaker.

Peña Nieto has been loathe to put himself in an environment in which the more imposing Trump could play the bully. The Mexican president’s style is exceedingly formal, and he is averse to verbal combat.

With Mexico heading into a July presidential election, any action by Peña Nieto that could be seen as kowtowing to Trump or buckling under U.S. pressure risks damaging the prospects for his Institutional Revolutionary Party.

The two presidents’ public posturing over the wall has harmed their personal relationship and jeopardized the alliance between their neighboring countries.

Still, talks between their respective administrations continue apace on the North American Free Trade Agreement and other issues. And both governments have striven to portray their ties as strong and the exchanges between their leaders as smooth.

“We enjoy a great relationship with Mexico and the two administrations have been working for a year to deepen our cooperation across a range of issues including security, immigration, trade and economics,” Michael Anton, the top spokesman for Trump’s National Security Council, said in a statement.

Mexican Foreign Secretary Luis Videgaray called the U.S.-Mexico relationship “closer” under Trump than in previous administrations. Traditionally, U.S. presidents have prioritized visits with their Mexican counterparts soon after taking office, considering the close ties between the countries.

But in January 2017, just days into Trump’s presidency, Peña Nieto called off a planned trip to meet Trump in Washington amid an escalating war of words between the two leaders over the wall proposal.

Earlier this month, a delegation of Mexican officials led by Videgaray met at the White House with senior adviser Jared Kushner — who is charged with managing the U.S.-Mexico relationship — and National Security Adviser H.R. McMaster and other administration officials to work out the parameters for a Peña Nieto visit, officials said.

The Mexican officials left the Feb. 14 meeting believing they had an agreement with the U.S. side that Trump would not embarrass Peña Nieto by bringing up his desire for ­Mexico to fund the wall.

One Mexican official described his country’s position as this: “You cannot talk about the bloody wall.” This official said Videgaray left Washington believing Trump would not broach the wall during Peña Nieto’s visit.

Trump and Peña Nieto made plans to speak by phone Feb. 20 and, assuming the call went well, their staffs would finalize an itinerary for the White House visit.

But the call did not go smoothly. Trump said that he would not be bound by any such agreement and could not commit himself to not talking about the wall.

“That was a deal-breaker for us,” the Mexican official said.