Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Donald Trump's outwardly friendly visit with Mexican President Enrique Peña Nieto hit a wall on Wednesday evening as the two sides issued contradictory accounts of the meeting.

The dispute centered on Trump's campaign pledge to force Mexico to pay for a barrier along their shared border. After his private sit-down with Peña Nieto, Trump told reporters at a joint press conference that they had set the issue aside in favor of a conversation on trade, immigration, and security.

“We did discuss the wall; we didn’t discuss payment of the wall,” Trump told reporters at a brief press conference alongside Peña Nieto after their meeting. “That will be for a later date.”

Peña Nieto declined to address Trump's statement from the podium, but his office rushed to counter Trump's version of events after the press conference ended, creating confusion about the content of their discussions.

"At the start of my conversation with Donald Trump I made it clear that Mexico will not pay for the wall," Peña Nieto tweeted in Spanish from his official account afterwards. "After that, the conversation moved on to other topics and unfolded in a respectful manner."

Trump's spokesman Jason Miller issued a follow-up statement saying the joint meeting "was not a negotiation" over the wall and that such talk would have been "inappropriate," but he added no further details corroborating or denying the Mexican president's revised account.

"It is unsurprising that they hold two different views on this issue, and we look forward to continuing the conversation," Miller said.

Hillary Clinton's campaign initially mocked Trump for not bringing up his wall, but soon followed up with a new statement that accused Trump of falsely representing his meeting.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"It turns out Trump didn't just choke, he got beat in the room and lied about it," Clinton campaign chairman John Podesta said in a statement.

Trump just failed his first foreign test. Diplomacy isn't as easy as it looks. -H — Hillary Clinton (@HillaryClinton) September 1, 2016

Clinton later tweeted: "Trump just failed his first foreign test. Diplomacy isn't as easy as it looks."

The high-stakes debate over what was said at the meeting overshadowed what at first appeared to be a relatively smooth event.

Trump said he had “tremendous respect” for Peña Nieto but repeated his criticism that Mexico had benefited disproportionately from free trade, which he has pledged to address via punitive tariffs.

"We must take action to stem this tremendous outflow of jobs from our country," Trump said. "It’s happening every day, it’s getting worse and worse and worse, and we have to stop it."

Peña Nieto is suffering through a difficult stretch in his presidency, with his approval rating hitting 23 percent in one recent poll amid a series of scandals and criticism. His low standing raised speculation that he might use the meeting to publicly rebuke Trump, who has been vilified in the Mexican press, but he carefully maintained a respectful tone throughout.

“Although we do not agree on everything we trust that together we'll be able to find greater prosperity without losing sight of the facts that liberty and independence are the grounds for everything we do,” he said.

Still, his remarks were a subtle rejoinder to Trump. He noted that the United States exports significant amounts of good to Mexico, that illegal immigration by Mexicans peaked years ago and had since fallen to net negative levels, and asked Trump for help stopping the flow of illegal guns from America into Mexico.

In his most direct rebuke, he defended the character of Mexican immigrants who Trump famously accused of being “rapists” and “criminals” in his announcement speech.

“Mexicans in the United States are honest people and hard working, they're well-intentioned people, they are good people who respect the institution of the family and community life and respect the law,” he said, according to a translation.

While he did not mention Trump’s past remarks, he acknowledged that “Mexicans have felt offended by what has been said.”

Pushing his usual economic nationalism outward, Trump said he would work with Mexico to "keep manufacturing wealth in our hemisphere" amid competition from rivals like China.

Trump has made illegal immigration a theme of his campaign, but much of his vitriol was directed at the Mexican government itself, raising speculation heading into his meeting Wednesday that their conversations might become confrontational.

“They are not our friend, believe me,” Trump said of Mexico in his announcement speech last year. On Twitter, he labeled Mexico one of America’s “enemies” and regularly described its leaders and judicial system as “corrupt.”

His depiction of many Mexican immigrants as “rapists” garnered the most attention politically, but he also claimed -- without evidence -- that Mexican leaders deliberately send undesirable immigrants (“the bad ones,” as he sometimes put it) across the border. When pressed for proof of his accusation, which immigration experts dismissed as an unsubstantiated conspiracy theory, Trump said in a primary debate that he had heard it from unnamed “border patrol people.”

These accusations did not go over well in Mexico, nor did Trump’s boast that he would build a border wall and force their leaders to provide the funding.

“I am not going to pay for that f---ing wall,” former Mexican President Vicente Fox said in an interview with Univision in February. Trump shot back in a primary debate that “the wall just got 10 feet taller.” The two politicians renewed their hostilities on Wednesday with Fox accusing Trump of “trying to make love to Mexicans, when he promised his followers to throw us out.”

Given that history, it’s fair to say Trump’s meeting was relatively diplomatic by comparison.

“It’s been a tremendous honor and I call you a friend,” Trump said to Peña Nieto after their meeting.