Both leaders had previously agreed to not publicly discuss the border wall.
The two leaders have since spoken by phone, and a series of high-level meetings have eased the tension.
Nieto cringed at the remark.
Popular Video This young teenage singer was shocked when Keith Urban invited her on stage at his concert. We're negotiating NAFTA and some other things with Mexico. "This is not a subject to bilateral",-he said adding that the meeting had been "respectful and cordial".
Videgaray disclosed that negotiations of a new NAFTA trade deal would begin on August 16.
"And this way, Mexico will have to pay much less money".
Estimates say the border barrier will cost billions of dollars.
The two presidents also explored a possible guest worker programme for migrants in the agriculture sector as well as the importance of "modernizing" NAFTA, according to a statement from Mexico's government released after the meeting. President Trump has also received skepticism from his own supporters regarding his lack of progress on the wall, as bids to build the wall are still now under review.
During his visit, Kelly also met with Mexican troops fighting the country's powerful drug cartels and took a surveillance flight over opium poppy fields in the restive state of Guerrero. "He didn't. Trump is a bully, but Pena Nieto is a coward".
As members of the media were being ushered out of the room, Darlene Superville of The Associated Press asked: "Mr. Trump, do you still want Mexico to pay for the wall?"
"The issue of the wall was not discussed, it was not part of the conversation", Videgaray told reporters after the meeting, adding that the U.S. and Mexico share a "complex relationship with many, many issues".
But Svetlana Lukash, a Russian official accompanying Putin at the talks, said the meeting that began around 4 p.m. local time was still ongoing at 5:50 p.m.