MEXICO CITY (AP) -- One of President Enrique Pena Nieto's closest advisers and confidants, Finance Secretary Luis Videgaray, has resigned, in a move observers said was linked to the unpopular decision to invite Republican presidential candidate Donald Trump to visit Mexico.
While Pena Nieto has taken responsibility for the decision to invite Trump, a former official familiar with the workings of the administration said Videgaray would have had a definitive input into the decision. 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.
Videgaray acted as Pena Nieto's campaign manager during his 2012 election campaign, and has been seen as the architect of many of the administration's policies. He led Mexico's Treasury department and is sometimes referred to as treasury secretary or minister, but because he oversaw budgets and fiscal policies, his role was closer to that of a finance secretary.
Pena Nieto thanked Videgaray for leading financial reforms at a ceremony at which the president announced that he was accepting the resignation, but did not announce any new post for Videgaray.
"He has been an official very committed to Mexico, and very loyal to the president," Pena Nieto said.
Former finance secretary Jose Antonio Meade - who had since served as foreign relations secretary and social development secretary - will return to the Treasury Department to replace Videgaray. Luis Enrique Miranda Nava will take over the social development post.
Pena Nieto said Meade will be in charge of turning in a primary budget surplus for next year, meaning government spending will have to be less than revenues, not including interest payments on debt.
Pena Nieto was also ridiculed for not confronting Trump more directly the visit about comments calling migrants from Mexico criminals, drug-runners and "rapists," and the U.S. candidate's vows to build a border wall and force Mexico to pay for it.
The wall proposal has been criticized widely and fiercely in Mexico.
Speaking at a town hall late Thursday where he fielded questions from young people, Pena Nieto sought to defend his decision to invite Trump to visit.
He said the easier path would have been to "cross my arms" and do nothing in response to Trump's "affronts, insults and humiliations," but he believed it necessary to open a "space for dialogue" to stress the importance of the U.S.-Mexico relationship.
"What is a fact is that in the face of candidate Trump's postures and positions, which clearly represent a threat to the future of Mexico, it was necessary to talk," Pena Nieto said hours after his annual state-of-the-nation report was delivered to congress. "It was necessary to make him feel and know why Mexico does not accept his positions."
He acknowledged Mexicans' "enormous indignation" over Trump's presence in the country and repeated that he told him in person Mexico would in no way pay for the proposed border wall.
Pena Nieto came under fire for not responding to Trump's mention of the wall during a joint news conference on Aug. 31, something he has since sought to correct.
A day later, Trump tweeted that Mexico would pay for the wall, Pena Nieto fired back his own tweet saying that would "never" happen.
Democratic presidential candidate Hillary Clinton, also invited to visit by Pena Nieto, said this week that she won't be going to Mexico before Election Day. She called Trump's quick stop in Mexico City "an embarrassing international incident."