MEXICO CITY - Donald Trump told Mexican President Enrique Peña Nieto on Wednesday he would build a border wall to keep illegal migrants out if he wins the U.S. presidency, but Peña Nieto held fast to his position that Mexico would not pay for it.

Contradicting Trump’s assertion that the pair did not discuss who would pay for his proposed wall, Peña Nieto said after the departure of the Republican presidential candidate that he told him during their private meeting in Mexico City that his government would not pick up the bill.

“At the beginning of the conversation with Donald Trump I made it clear that Mexico will not pay for the wall,” Peña Nieto said in a tweet after not mentioning the issue during their joint news conference.

Al inicio de la conversación con Donald Trump dejé claro que México no pagará por el muro. — Enrique Peña Nieto (@EPN) August 31, 2016

Mexico's president being interviewed on Televisa: "I was clear and emphatic that Mexico will not pay for the wall" https://t.co/hIVOOv46sd — Jon Passantino (@passantino) September 1, 2016

Trump gave a different account of the conversation, which was aimed at repairing relations damaged by the real estate mogul’s attacks on Mexico and migrant workers on the campaign trail.

“We did discuss the wall, we didn’t discuss payment of the wall, that will be at a later date, this was a very preliminary meeting. It was an excellent meeting,” Trump said.

His campaign waved off Peña Nieto’s statement, calling the meeting a first attempt at building a relationship.

“It was not a negotiation, and that would have been inappropriate. It is unsurprising that they hold two different views on this issue, and we look forward to continuing the conversation,” Trump spokesman Jason Miller said.

Mike Pence on CNN: "The subject of the wall was discussed” but not in detail. — Steve Peoples (@sppeoples) September 1, 2016

Because there was no discussion, spox says @realDonaldTrump wasn't lying when he said they didn't discuss who would pay for wall. 3/3 — David Luhnow (@davidluhnow) September 1, 2016

Many Mexicans were furious about Trump’s visit, deeply offended by how Trump has labeled Mexicans as rapists and drug traffickers, and wanted an apology. That did not come.

Even in private, Trump did not apologize to Peña Nieto, presidential spokesman Eduardo Sanchez told Reuters.

Trump is trailing Democratic rival Hillary Clinton in opinion polls for the Nov. 8 election. The New York businessman’s aides hoped the trip would make him look presidential and show he is willing to deal head on with a thorny issue like relations with Mexico.

The scenes of a measured Trump meeting with a foreign leader were aimed at convincing moderate American voters to see him in a more positive light as he tries to broaden his appeal.

Trump’s call for Mexico to fund the wall is often the central moment of his campaign rallies. He asks the crowd who will pay for the wall, and supporters shout back, “Mexico!”

DEMONSTRATORS: “TRUMP AND PEÑA OUT”

Mexican opposition politicians attacked Peña Nieto for hosting Trump.

The Republican candidate first made his accusations that Mexico is sending criminals and rapists across the border and pledged to build a wall that Mexico would pay for when he launched his presidential bid in June last year. He has also accused Mexico of cheating the United States on trade.

The Mexican president said the many millions of Mexicans in the United States deserve respect, but offered only a mild rebuke of Trump for his rhetoric.

“The Mexican people has felt aggrieved by comments that have been made, but I was sure his interest in building a relationship is genuine,” Peña Nieto said at their joint news conference after the talks.

A few dozen demonstrators gathered beneath a monument to Mexican independence in the center of the capital to protest the visit, some holding placards emblazoned with captions such as “You are not Wall-come” and “Trump and Peña out.”

Peña Nieto has been enmeshed in his own controversies, including over whether he plagiarized some of his 1991 undergraduate law thesis.

Trump’s visit to Mexico City took place hours before he was due to deliver a highly anticipated speech in the U.S. border state of Arizona on how he will tackle illegal immigration if he wins the election.

Trump has been pilloried in Mexico since he launched his White House campaign last year.

He has pledged to renegotiate or scrap the 1994 North American Free Trade Agreement trade deal between the United States, Mexico and Canada.

Clinton, a former secretary of state, said on Wednesday that Trump could not paper over his previous harsh language against Mexico, which helped him defeat 16 rivals for the Republican presidential nomination.

“It certainly takes more than trying to make up for more than a year of insults and insinuations by dropping in on our neighbors for a few hours and then flying home again,” she told a convention of the American Legion military veterans’ group in Cincinnati.

(Additional reporting by Steve Holland, Amanda Becker, Caren Bohan and Ginger Gibson in Washington; Writing by Alistair Bell; Editing by Simon Gardner and Leslie Adler)

Editor’s note: Donald Trump regularly incites political violence and is a serial liar, rampant xenophobe, racist, misogynist and birther who has repeatedly pledged to ban all Muslims — 1.6 billion members of an entire religion — from entering the U.S.