U.S. Republican presidential candidate Donald Trump addresses a joint press conference with Mexican President Enrique Pena Nieto (not seen in the picture) after their meeting in Mexico City, capital of Mexico, on August 31, 2016.
Videgaray also faced accusations of conflicts of interest when it was relvealed that he bought a house in an exclusive golf resort in the central State of Mexico, considered a Pena Nieto's stronghold.
Mr. Peña Nieto announced Mr. Videgaray's resignation at a news conference.
Newspaper columnists in Mexico have reported Videgaray was behind last week's visit, in which Pena Nieto was criticized for not being forceful enough in rejecting Trump's proposals and comments about Mexico. The New York businessman has repeatedly vowed to build a border wall to keep out illegal immigrants - which he said Mexico would pay for.
New finance minister Meade is a friend of Videgaray's and had started in the administration as foreign minister before moving to the social development ministry past year.
Pena Nieto, flanked by both men at the presidential residence of Los Pinos, praised Videgaray as a public servant who has been "committed to Mexico and loyal to the president".
Trump himself said Videgaray's resignation was related to his visit.
Pena Nieto has faced a truckload of criticism after Trump's brief visit, with many Mexicans complaining that the president was poorly advised by the people around him.
The visit was highly criticized by Mexicans, with many saying that it was a betrayal and a humiliation to the country to have Trump there.
Videgaray managed the campaign that led Peña Nieto to the presidency in 2012 and he is also credited with being the architect of the neoliberal economic reform plans that have characterized the administration's policies.
Videgaray's departure comes with the economy not performing as well as hoped, shrinking by 0.3 percent in the second quarter, while the peso has dropped against the dollar.
Videgaray was also ensnared in a scandal over his purchase of a home from a government contractor. Analysts have seen him as a potential candidate to follow in his footsteps in the national election of 2018, or to become the candidate for Pena Nieto's Institutional Revolutionary Party in the State of Mexico governor's election next year. "Some say he did well, others say the debt has increased".