"This morning we have informed the White House that I will not attend the meeting scheduled for next Tuesday with the POTUS," Peña Nieto tweeted.
Earlier Thursday morning, Trump had tweeted that it would be better to skip the meeting if Peña Nieto continued to insist Mexico would not pay for the wall -- something the Mexican leader had said as recently as Wednesday evening.
"If Mexico is unwilling to pay for the badly needed wall, then it would be better to cancel the upcoming meeting," Trump tweeted and in an earlier tweet he noted the US's trade deficit with Mexico and what he said were the American job losses caused by NAFTA.
Trump spoke about the cancellation during remarks at a gathering of congressional Republicans in Philadelphia.
Trump said that he and the Mexican president had mutually agreed to scrap their planned get together, and he repeated his position that the US won't fund the wall.
"Unless Mexico will treat the US fairly, with respect, such a meeting is fruitless, and I want to go a different route," Trump told House and Senate GOP lawmakers. "I have no choice."
"Border security is a serious, serious issue and a national problem," Trump said. "Most illegal immigration is coming from our Southern border."
On Wednesday night, Peña Nieto had said at that time he did not see a need to scrap the get together -- but he strongly reiterated that his country wouldn't fund any border wall, which Senate Majority leader Mitch McConnell said Thursday would cost $12-$15 billion
"President Trump's insistence that Mexico will pay for the wall has once again just been proven as delusional fiction by the Mexican President," said House Democratic leader Nancy Pelosi. "The wall is a multi-billion dollar boondoggle in the making, and Republicans should be embarrassed about their brazen hypocrisy in enabling it."
"Mexico does not believe in walls. I've said time again; Mexico will not pay for any wall," the Mexican president said in a video statement posted to Twitter and translated by CNN from Spanish.
The back-and-forth between the two leaders began last year during the first days of the Trump campaign when he called some Mexicans entering the US criminals and rapists and tensions lingered throughout the 2016 contest. They escalated sharply over the last 24 hours when Trump took executive action on Wednesday to begin the process of erecting a wall.
The President announced that move while a high-level Mexican delegation was visiting the White House -- the first foreign representatives to come since Trump took office -- for meetings with top officials, including Chief of Staff Reince Priebus and adviser Jared Kushner.
One member of the delegation, Mexican Foreign Minister Luis Videgaray, who had led talks between his government and the Trump transition team, was in his car on his way to meetings at the Department of Homeland Security on Thursday when he suddenly decided he would not attend.
"We will work to schedule a future meeting and will continue to keep the lines of communication and partnership open," said DHS Spokeswoman Gillian Christensen.
In his video address, Peña Nieto also said he had ordered government agencies to step up protection for immigrants.
"I've asked for the minister of Foreign Relations to re-enforce protection measures to our citizens," he said. He added that the 50 Mexican consulates in the US will be used to defend the rights of immigrants in the country and issued a call to action to legislators and civic organizations to help immigrants.
Peña Nieto closed his message by saying Mexico offers and expects respect. "Mexico offers its friendship to the people of the United States and expresses its wish to arrive at agreements with its government, deals that will be in favor of Mexico and the Mexicans," he said.
Earlier Wednesday, Trump signed two executive orders directing construction of a wall on the US-Mexico border, boosting border patrol forces, and increasing the number of immigration enforcement officers who carry out deportations.
Meanwhile, the Mexican officials who arrived Wednesday had been expected to lay the groundwork for Peña Nieto's visit next week, which Mexican diplomats had seen as an important opportunity to try to move past the anti-Mexico rhetoric Trump used during the campaign and a chance to put the relationship back on track.
"There is ... frustration with our government and ourselves that we have not been able to tell the story of this important relationship," a Mexican diplomat told CNN ahead of the delegation's visit. "There are a lot of stereotypes of Mexicans in the US, but there are also stereotypes of Americans in Mexico. It is in the interest of both governments to explain what this relationship is and what we can do together."
In a Monday speech, Peña Nieto said his government is prepared to negotiate with the US if Mexico's national sovereignty is respected. He laid out economic integration and respect for the rights of migrants and the money they send home as his nation's key negotiating points.
"Neither confrontation nor submission. Dialogue is the solution," Peña Nieto said.
Trump has suggested some of the $25 billion in annual remittances that migrants return home would be retained to pay for the border wall.
Trump flew to Mexico City during his campaign to meet Peña Nieto and said they discussed a wall Trump has vowed to build on the US southern border, but not his demand that Mexico pay for it -- an assertion the Mexican president later disputed.
"At the start of the conversation with Donald Trump, I made it clear that Mexico will not pay for the wall," Peña Nieto tweeted, after their meeting, which was widely viewed as a public relations disaster for Peña Nieto.