Mexico's new Foreign Relations Secretary Luis Videgaray stands during a press conference at the Los Pinos presidential residence in Mexico City, Wednesday, Jan. 4, 2017. Mexico's president has brought back Videgaray, a close adviser who resigned after arranging a meeting between Pena Nieto and then-presidential candidate Donald J. Trump. (AP Photo/Marco Ugarte)

Mexico's new Foreign Relations Secretary Luis Videgaray stands during a press conference at the Los Pinos presidential residence in Mexico City, Wednesday, Jan. 4, 2017. Mexico's president has brought back Videgaray, a close adviser who resigned after arranging a meeting between Pena Nieto and then-presidential candidate Donald J. Trump. (AP Photo/Marco Ugarte)

MEXICO CITY (AP) — President Enrique Pena Nieto on Wednesday brought back a close adviser and Cabinet secretary who had stepped down after arranging a presidential meeting with Donald Trump, a move that angered Mexicans upset by the then-Republican candidate’s comments about migrants.

Pena Nieto appointed former Finance Secretary Luis Videgaray as his new foreign relations secretary and gave him the job of trying to establish contacts and dialogue for a constructive relationship with Trump’s administration, which takes power Jan. 20.

“It should be a relationship that allows us to strengthen bilateral ties in security, trade, migration and investment,” Pena Nieto said. “These goals should be attained by promoting Mexico’s interests without undermining its sovereignty or the dignity of Mexicans.”

ADVERTISEMENT

He also said Videgaray should protect the rights of Mexicans living in the United States.

In brief comments after his appointment, Videgaray said that “the challenges are enormous, the threats are there.”

As if to underscore the challenges, Mexico’s peso sank to a new historic low against the U.S. dollar, with the interbank rate closing Wednesday at 21.52 pesos to $1.

Relations with Trump have been testy following his campaign comment that some Mexican migrants were rapists and criminals, his promise to build a wall between the countries, and his recent push to stop U.S. companies from moving jobs to Mexico. He has also promised to change the North American Free Trade Agreement with Mexico and Canada and crack down on illegal immigration.

Pena Nieto’s Aug. 31 meeting with Trump dealt a blow to the Mexican leader’s already-low approval ratings, and he later acknowledged Videgaray resigned because he helped arrange the visit. Many Mexicans felt Pena Nieto was not forceful enough in denouncing Trump’s comments during the meeting and instead gave a pre-election boost to a man widely loathed in Mexico.

At the time, Trump praised Videgaray, tweeting that “Mexico has lost a brilliant finance minister and wonderful man who I know is highly respected by President Pena Nieto.”

But Trump also said, “The people that arranged the trip in Mexico have been forced out of government. That’s how well we did.”

Pena Nieto defended the visit as necessary to open a “space for dialogue” to stress the importance of the U.S.-Mexico relationship.

Some saw Videgaray’s return as unavoidable, given Trump’s election victory.

“It is easy to insult him (Trump) and put his face on pinatas,” analyst Gabriel Guerra wrote in the newspaper El Universal. “The real challenge is to find the least painful way to get along with him, and I don’t think there is anyone better to try to do that in these difficult moments than Luis Videgaray.”

Others saw it as a futile gesture to appease Trump.

ADVERTISEMENT

“Changing the head of the Foreign Relations Department will not prevent the new U.S. president from carrying out his plan to renegotiate or cancel NAFTA, nor will it influence his anti-immigrant policies,” the leftist Democratic Revolution Party said in response to the appointment.

Videgaray was Pena Nieto’s campaign manager during his 2012 election campaign and was seen as the architect of many administration policies. He led Mexico’s Treasury Department and was 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.

He replaces Claudia Ruiz Massieu as foreign secretary.

He has shared both in the president’s triumphs and embarrassments. In 2014, Videgaray acknowledged he had bought a house from the same government contractor that sold a mansion to Pena Nieto’s wife, Angelica Rivera, in the administration’s deepest scandal.