A top Mexican official who allegedly helped arrange the Donald Trump's visit to his country has resigned.

Luis Videgaray, seen as the right-hand man to President Enrique Pena Nieto, has left and will be replaced by Jose Antonio Meade, a former finance chief.

Many in Mexico saw Trump's meeting with Pena Nieto as a humiliation for Mexico. Local media has reported the Trump visit was Videgaray's idea, though both he and Pena Nieto have denied that.

Videgaray was finance minister from 2011 to 2012 under former President Felipe Calderon, and had previously been his energy minister. Under Pena Nieto, he was foreign minister and minister for social development.

According to Finance Ministry spokeswoman Claudia Algorr, the 48-year-old Videgaray will not take another post in the government anytime soon.

Videgaray is credited for helping Mexico's economy grow with high-profile reform, including opening the nation's oil industry to private investors, but had come under fire for two years slow economic growth.

Trump claimed his trip to Mexico was a success, and has held onto his claim that the country will pay for his proposed border wall.