A spokesperson for the ministry said Mr Videgaray would not take on another public office and will be replaced by the current Minister of Social Development, Jose Antonio Meade who had previously held the finance portfolio in 2011 and 2012.
Mr Trump, the Republican nominee for the US presidency, visited Mexico briefly on 1 September, despite widespread condemnation over some of his ‘rapists and criminals’ comments about Mexican migrants to the United States.
Mr Videgaray has been one of the president's closest advisers, orchestrating a successful election campaign in 2012.
However, Mr Trump's visit was seen as a national embarrassment when he appeared later that day at a rally in Arizona saying he told the crowd Mexico that they would pay for a planned border wall "100%", contrary to his earlier statement to reporters that he had not discussed the issue with President Pena Nieto.
Meanwhile president Nieto insisted he had told Mr Trump that Mexico would not pay for the wall.
In 2014, Mr Videgaray came under fire when a newspaper investigation revealed he had bought his home from a construction firm whose parent company had won major public contracts.
He denied any wrongdoing or conflict of interest. President Pena Nieto said the new minister will "apply adjustments to public spending" but there will not be any rise in taxes.