Trump told a cheering crowd of supporters in Arizona later on Wednesday that Mexico would pay for the wall 100 percent.
Donald Trump's pledge to make Mexico pay for a border wall is "outrageous," its government said on Thursday, one day after the Republican presidential candidate visited Mexico City for talks with President Enrique Pena Nieto.
"The proposal to build the wall, and to believe that Mexico could and would pay for it, is outrageous," presidential spokesman Eduardo Sanchez told local radio, after Trump's rapid, impromptu visit to Mexico on Wednesday.
"What I know is that Mexico will not pay a single cent if they want to build a wall on that side of the border," he added.
On Twitter early on Thursday, Trump wrote, "Mexico will pay for the wall!"
That prompted a Twitter reply from Pena Nieto later in the day: "I repeat what I told you personally Mr Trump, Mexico would never pay for a wall."
Trump has sparked anger in Mexico with accusations on the campaign trail that the country sends rapists and drug runners to the United States, as well as his threats to tear up trade deals and make Mexico fund his planned wall.
At a news conference after their 70-minute meeting, Trump said he and Pena Nieto had not discussed who would pay for the wall he wants to prevent illegal immigrants from crossing the border.
A few hours later, Pena Nieto contradicted Trump, saying he had told the American that Mexico would not foot the bill.
However, Trump told a cheering crowd of supporters in Arizona later on Wednesday that Mexico would pay for the wall "100 percent."
After Trump had left Mexico, Pena Nieto was at pains to stress how he had brought home to the New York businessman the offense his comments have caused, calling his proposals a threat to the country.
"I was very clear - in private and in public - in stressing that in Mexico we feel offended and hurt by his pronouncements about Mexicans," Pena Nieto wrote in a piece in the newspaper El Universal on Thursday entitled "Why did I meet Donald Trump?"
"In his campaign speeches, Trump has not treated us like partners, nor as allies, based on a distorted picture of Mexico and its people," he went on, saying he had told Trump future cooperation between the two nations must be based on mutual respect.
"Donald Trump's reaction was positive," he said.