Mexican Official Who Helped Arrange Trump Visit Returns to High Office The former finance secretary will become foreign secretary, the president said.

 -- In a stunning reversal, Mexico's president said today that an official who resigned four months ago in the wake of then-presidential candidate Donald Trump's visit to Mexico will now become the country's secretary of foreign affairs.

Mexican President Enrique Peña Nieto announced that Luis Videgaray, who stepped down as finance secretary after helping set up a controversial meeting between Trump and Peña Nieto last year, would rejoin the government in a role crucial to the future of the U.S.-Mexico relationship.

While Videgaray's ties to Trump's team were considered a liability before Trump won the U.S. presidential election in November -- Trump has been widely unpopular there -- his connections could prove useful to Mexican leadership jittery over Trump's pronouncements on immigration, a wall on the U.S.-Mexico border and trade between the two neighbors. Peña Nieto today assigned Videgaray to working with Trump's administration, which takes office Jan. 20.

Trump's visit to Mexico City in August resulted in significant blow-back for Peña Nieto, who appeared at a joint press conference with Trump following a bilateral meeting. That day, Trump said the two did not discuss who would pay for his promised border wall -- he had frequently said during this campaign that Mexico would foot the bill. After not challenging Trump during their appearance together, Peña Nieto soon after took to Twitter to claim he told Trump Mexico would not pay.

Videgaray, a longtime aide to Peña Nieto who helped arrange the meeting, resigned soon afterward.

After Videgaray stepped down, Trump praised him in a tweet. "Mexico has lost a brilliant finance minister and wonderful man who I know is highly respected by President Peña Nieto," Trump said at the time.

"With Luis, Mexico and the United States would have made wonderful deals together - where both Mexico and the US would have benefitted [sic.]," Trump tweeted of Videgaray, a former investment banker.

Anne Laurent contributed reporting from Mexico City.