Secretary of State Rex Tillerson (L) and Mexican Foreign Minister Luis Videgaray arrive to a joint press conference at the Foreign Ministry building in Mexico City on February 23, 2017.

Secretary of State Rex Tillerson continued talks with Mexican officials on Thursday ahead of a planned meeting with President Enrique Peña Nieto — a trek that President Donald Trump himself acknowledged was "going to be a tough trip."

"This visit takes place at a complex time for relations between our two countries," Mexican Foreign Minister Luis Videgaray said after his meeting with Tillerson and Homeland Security Secretary John Kelly.

"At a time when both of our countries and our governments have notable differences, the best path to solving them is dialogue," he added.

More from NBC News:

White House offers response to upset GOP town hall attendees

Bank manager pleads guilty to stealing from private accounts

Full McCain interview: 'I worry about the president's understanding' of some issues



Tillerson, the new head of the State Department, is working to smooth over tensions sparked by brash rhetoric, plans to build a border wall, and most recently the Department of Homeland Security's new immigration guidelines. The plans unveiled Tuesday would consider almost all undocumented immigrants subject to deportation, and includes sending those who enter the U.S. illegally via the southern border back to Mexico, even if they aren't from there.

Videgaray, Mexico's lead negotiator with the Trump administration, said Wednesday there was no way Mexico would accept the new rules.

"I want to say clearly and emphatically that the government of Mexico and the Mexican people do not have to accept provisions that one government unilaterally wants to impose on the other," he told reporters at the foreign ministry.

"We also have control of our borders and we will exercise it fully," he said.

On Thursday, Videgaray and Tillerson described their talks as "productive" and discussed getting to the source of the Central American migration issue, the implication of U.S. policies on Mexico and preventing terrorism and criminal activity.

Tillerson also stressed that controversial deportations would be conducted legally.

"The focus of deportation will be on the criminal element, all of this will be done in close coordination with Mexico," he said.

Roberto Campa, who heads the human rights department of the Interior Ministry, said the plan to deport non-Mexicans to Mexico was "hostile" and "unacceptable."