MEXICO CITY — U.S. Defense Secretary Jim Mattis stepped into politically fraught U.S. relations with Mexico, seeking Friday to add a calming voice to the two neighbors’ defense ties.

Mattis was meeting with senior government officials in the capital on the eve of Mexico’s national Independence Day.

The relationship between Mexico and the United States has faced new challenges under President Donald Trump, who referred to Mexican immigrants as criminals and rapists during his election campaign. Trump also has insisted Mexico will pay for a U.S. border wall, and has taken a series of measures to boost immigration enforcement.

On his flight Friday to Mexico City, Mattis said his visit is intended to build on what he called a steady defense relationship. He said he did not expect Mexican officials to raise the border wall issue or other contentious political matters.

“We have very supportive military-to-military ties, and this is simply to reinforce that,” Mattis told reporters traveling with him from Nebraska, where he met Thursday with the commander of Strategic Command and monitored North Korea’s ballistic missile launch over Japan.

He called U.S.-Mexico security relations “very, very strong” and “built on trust and respect.”

Mattis said he intended to discuss the usual array of defense-related issues with his Mexican counterpart and other officials during a daylong visit. It will be capped by an official reception to celebrate Mexico’s independence. He said the talks would encompass the fight against drug trafficking and human trafficking, countering government corruption and reducing U.S. demand for illegal drugs.

Mattis said Mexico, like other countries, has its problems and is “keenly aware of these.” Mexico is dealing with them, he said.

The last U.S. defense secretary to visit Mexico was Chuck Hagel in April 2014. Military relations between the U.S. and Mexico have long been troubled, beginning with Mexico’s loss of territory to the U.S. in the 1800s. More recently, ties have been strained by the battle against cross-border drug trafficking.

Mattis also was meeting in Mexico City with Gen. Lori Robinson, the commander of U.S. Northern Command, which is responsible for defense of the American homeland and manages the defense relationship with Mexico.