Mexico vowed not to let the United States impose migration reforms on it Thursday as its leaders hosted US officials who are cracking down on undocumented immigrants.
Foreign Minister Luis Videgaray sharpened the tone as he prepared for talks following a diplomatic row over President Donald Trump's hard line on trade and immigration.
Trump has outraged Mexico by vowing to build a wall along the border to keep out migrants from Latin America, whom he branded rapists and criminals during his presidential campaign.
His government has issued new orders to begin arresting and deporting undocumented immigrants, many of them Mexicans, in what Trump called a "military operation" on Thursday.
"The Mexican government and people do not have to accept measures that one government wants to impose unilaterally on another," Videgaray said late Wednesday.
"We are not going to accept that because we do not have to do it and it is not in Mexico's interests."
He said Mexico would use "all legally possible means" to defend Mexicans living abroad, including potentially appealing to the United Nations.
President Mexican Enrique Pena Nieto and Videgaray met with US Secretary of State Rex Tillerson and Homeland Security chief John Kelly on Thursday.
US officials said the talks would focus on how to curb cross-border migration and drug-trafficking and to affirm their bilateral ties.
Trump's stance has strained previously good US-Mexican relations, said Maureen Meyer, an expert at the Washington Office on Latin America, a US human rights advocacy organization.
"Secretary Tillerson has an opportunity to set relations on a more sound footing based on mutual respect," she said in a statement.
Pena Nieto had canceled a planned meeting with Trump in Washington last month over the US leader's vow to make Mexico pay for the wall.
But White House spokesman Sean Spicer insisted Wednesday that Washington has "a very healthy and robust relationship with the Mexican government."
He said Thursday's talks aim "to improve the quality of lives for both people of Mexico and the United States by combating drug traffickers and finding ways to bolster both our economies through a broader relationship that promotes commerce and legal immigration."
US immigration authorities have arrested hundreds of people as part of Trump's pledge to crack down on undocumented immigrants.
Kelly on Tuesday issued new orders to step up the detentions.
Speaking in Guatemala on Wednesday before traveling to Mexico, Kelly said "to any citizen considering moving to the United States in crossing our boundaries irregularly — migration — my best advice is to not do it."
Mexico has hinted it could use border cooperation as a bargaining chip.
But in a move that may pressure Mexico, Trump has ordered US government agencies to count up how much aid they are giving to that country under different programs.
The United States has allocated $2.6 billion worth of aid to Mexico for fighting crime under the 2008 "Merida initiative," US officials say.
Kelly promised during a news conference on Thursday that there would be "no mass deportations" or military force against immigrants in the United States despite a crackdown on those in the country illegally.
"There will be no, repeat no mass deportations," he said after meeting with Mexican ministers. "There will be no use of military force for immigration operations."
Speaking hours earlier Thursday at the White House Trump made comments that appeared to contradict the message of his envoy to Mexico, describing the stepped-up deportation drive as "a military operation."
"We're getting really bad dudes out of this country, and at a rate that nobody's ever seen before," Trump said.
Tillerson emphasized the importance of the US and Mexico cooperating on border security, saying that he and Videgaray "reiterated our joint commitment to maintaining law and order along our shared border by stopping potential terrorists and dismantling the transnational criminal networks moving drugs and people into the United States."
But he agreed that cooperation on border security had to work both ways.
"We underscored the importance of stopping the illegal firearms and bulk cash that is originating in the United States and flowing into Mexico," he said.
"There's no mistaking that the rule of law matters along both sides of the border."