Donald Trump has insisted that Mexico will pay for the wall he wants to build along the length of the border with the US.
He said during a speech on immigration in Phoenix, Arizona that Mexico will pay for the wall "100%" and added: "They don't know it yet, but they're going to pay for" it.
The Republican presidential candidate earlier met Mexico's president and said they had not discussed who would pay for the massive wall that has been at the centre of his White House campaign.
But President Enrique Pena Nieto tweeted: "At the beginning of the conversation with Donald Trump, I made clear that Mexico would not pay for the wall."
The two men met privately in Mexico City on Wednesday afternoon.
It was Mr Trump's first meeting with a head of state as his party's presidential nominee and he described Mexicans as "amazing people".
He told reporters during the appearance that they did not discuss who would pay for the construction costs of the wall along the 2,000-mile border, a project that would cost billions.
In Phoenix, Mr Trump vowed to remove millions of people living in the US illegally if he becomes president, warning that failure to do so would jeopardise the "wellbeing of the American people".
The tycoon failed to outline what he would do with those who have not committed crimes beyond their immigration offences - a sharp retreat after earlier promises to create a "deportation force" to remove the estimated 11 million immigrants living in the US illegally.
"Anyone who has entered the United States illegally is subject to deportation," he said, adding: "There will be no amnesty."
Mr Trump also promised to restrict legal immigration, calling for a commission that would keep the percentage of foreign-born people in the country to "historic norms".
He said: "We have to listen to the concerns that working people, our forgotten working people, have over the record pace of immigration and its impact on their jobs, wages, housing, schools, tax bills and general living conditions."
Mr Trump was cheered in Arizona, but his appearance in Mexico sparked anger and protests.
The candidate is deeply unpopular in Mexico due in large part to his deriding the country as a source of rapists and criminals as he kicked off his campaign.
Former Mexican president Vicente Fox bluntly told the celebrity businessman that, despite Mr Pena Nieto's hospitality, he was not welcome.
"We don't like him. We don't want him. We reject his visit," Fox said on CNN, calling the trip a "political stunt".
Campaigning in Ohio, Democrat Hillary Clinton criticised Mr Trump's Mexican appearance as she promoted her own experience working with foreign leaders as the nation's chief diplomat.
"People have to get to know that they can count on you, that you won't say one thing one day and something totally different the next," she told the American Legion in Cincinnati.