Story highlights

Trump's visit to Mexico was controversial

A formal announcement was made Wednesday

Washington CNN  — 

Mexican President Enrique Peña Nieto announce Wednesday that his finance minister, Luis Videgaray, is out of his cabinet, a Mexican federal government official confirmed to CNNE.

“I would like to publicly express my highest recognition, not only as president, but also personally to someone who, without a doubt, has been a collaborator who has been deeply committed with the efforts our republic’s governments in order to propel Mexico’s transformation,” Peña Nieto said at a news conference. “He has been a government official who was committed to Mexico and loyal to the republic’s president. Thank you very much, Luis, for your service to our nation.”

The circumstances surrounding Videgaray’s exit were not immediately clear.

But a Mexican government official and a source close to the Mexican government both told CNN previously that the idea to extend invitations for Donald Trump and Hillary Clinton to meet with Peña Nieto came from the finance ministry.

Trump and Peña Nieto met last week.

Trump’s whirlwind visit to Mexico and private meeting with Peña Nieto gave the real estate mogul the visual of meeting with a foreign leader. Yet the trip later devolved into finger-pointing after Peña Nieto and Trump delivered contradicting accounts of the closed-door sit-down. Both leaders are unpopular in Mexico.

Trump has pledged to build a wall along the US-Mexico border and force the southern neighbor to pay for it. Peña Nieto has said unequivocally that his country will not pay for it.

Mexico invited Trump to show that it could work with the Republican nominee if he were to win, according to the source close to the government. Yet the foreign ministry was not aware of the invitations to Trump and Clinton, said the Mexican government official.