Asked whether he still expects Mexico to pay for his signature campaign promise, Mr Trump responded, “Absolutely”.
The world leaders met on the sidelines of the G20 summit in Hamburg, Germany. They had previously scheduled a meeting for the early months of Mr Trump's presidency, but cancelled over disagreements about the border wall.
"It is evident that we have some differences with the new government of the United States, like the topic of the wall, that Mexico of course will not pay," Mr Peña Nieto said at the time.
Nevertheless, Mr Trump on Friday said he considers the Mexican president a "friend". Mr Peña Nieto said only that he hopes to continue a "flowing dialogue".
The promise to build a wall along the US-Mexican border was a feature of Mr Trump's presidential campaign, during which he accused Mexican immigrants of "bringing drugs" and "bringing crime". The President claims the wall is necessary to protect against illegal immigration.
US Customs and Border Patrol recently announced they had started searching for a construction firm for the wall. Congress, however, has yet to authorise money to pay for it.
The most recent budget passed by Congress allocates $20m for prototypes, but no funding for the wall itself. Even Republicans in Congress appear unenthusiastic about the proposal.
Mr Trump, meanwhile, has started proposing alternative solutions, such constructing the wall with solar panels.
"This way, Mexico will have to pay much less money," Mr Trump explained during a rally in Cedar Rapids, Iowa. "A solar wall. It makes sense. Let's see. We are working it out."
Mr Trump previously met with Mr Peña Nieto in a surprise trip to Mexico during his campaign. At the meeting, he appeared to ignore the Mexican president's insistence that his country would not pay for the wall.
Later, when Mr Trump threatened to raise tariffs on Mexico to help pay it, Mr Peña Nieto cancelled their scheduled meeting.
Mr Trump's criticism of Nafta – a trade agreement between the US, Mexico, and Canada – has also inflamed relations between the countries. Mr Trump said at the meeting that he is "negotiating" the deal with Mexico.
"We’ll see how it all turns out but I think we've made very good progress," he said.
Mexican Foreign Minister Luis Videgaray, however, told Reuters he did not expect much to change as a result of Friday's meeting.
"We have to put it in context and not have expectations that are unjustified," he said.
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies