"This morning we informed the White House I will not attend the business meeting scheduled for next Tuesday with @POTUS," he tweeted in Spanish.
President Trump shared an alternative version of how events unfolded.
"To that end, the president of Mexico and myself have agreed to cancel our planned meeting scheduled for next week. Unless Mexico is going to treat the United States fairly with respect such a meeting will be fruitless ... we’ll have to go a different route," Trump said.
Peña Nieto is in a tough spot in his own country, as he reportedly has low approval ratings and received blowback when he met with Trump in August ahead of the U.S. election.
Peña Nieto and Trump first met during that August visit, when Trump was the Republican nominee and made a trip to Mexico. During a joint press conference immediately afterward, Trump said, "We didn't discuss who pays for the wall," but Peña Nieto later disputed that comment.
In two tweets posted more than an hour after that press conference, Peña Nieto wrote in Spanish that "at the beginning of the conversation with Donald Trump, I made it clear that Mexico will not pay for the wall." From there, the conversation turned to other topics and continued in a "respectful manner," he wrote.
Trump initially introduced the idea that the U.S. may pay for the wall upfront and then be reimbursed by Mexico during a campaign event in October when he said that he's operating "with the full understanding that the country of Mexico will be reimbursing the United States for the full cost of such a wall."
On Thursday, White House Press Secretary Sean Spicer floated a possible 20 percent border tax on Mexico as one possible idea for paying for the wall.
"I think when you take a look at the plan that's taking shape now using comprehensive tax reform as a means to tax imports from countries that we have a trade deficit from, like Mexico," he said. "We can do $10 billion a year and easily pay for the wall just through that mechanism alone."
Spicer later clarified that he was just presenting one possible option to pay for the wall and that a broader "comprehensive tax reform" plan is "in the early stages" of being crafted by the White House, with the close cooperation of congressional leaders.
"Our job right now isn't to roll something out or to be prescriptive, it's to show there are ways the wall can be paid for, full stop," Spicer said, qualifying his previous comments.
Many in Mexico City feel canceling the trip was the right thing for their president to do.
"I'm not a fan of the Mexican president but I'm happy he canceled the visit. Trump is capable of anything. If the Mexican president had gone there, Trump would have disrespected him and the Mexicans even more," said Gina Macassi, the owner of a grocery store in Mexico City.
Raul Olivares, a 28-year-old sociology student, told ABC News that it was an "important and symbolic decision," and tea shop owner Javier Vidrio, 43, said "it was about time."
"For the dignity of our country, it was a good idea," Alfredo Castillo, a 40-year-old taxi driver, said.
"We won't pay for the wall but we have to keep negotiating with the U.S."
ABC News' Anne Laurent and Jordyn Phelps contributed to this report.