MEXICO CITY (Reuters) - Distancing himself from political tensions over issues like the border wall, U.S. Defense Secretary Jim Mattis said he aimed to build trust and show respect for Mexico during a trip there on Friday that sought to buttress still resilient military ties between the two countries.

U.S. Defense Secretary James Mattis listens the national anthem next to Mexico's Defense Minister, General Salvador Cienfuegos (L), and Secretary of the Navy Admiral, Vidal Francisco Soberon (R), during a welcome ceremony at Plaza de la Lealtad square in the Secretary of National Defense headquarters in Mexico City, Mexico September 15, 2017. REUTERS/Edgard Garrido

U.S.-Mexican relations have been badly damaged by Trump’s threats to curtail trade with Latin America’s No. 2 economy as well as his demand that Mexico pay for a border wall to keep out immigrants and drug traffickers.

Mexicans’ positive image of the United States has fallen to its lowest level since at least 2002, with about two-thirds of people viewing the country unfavorably, according to a poll released on Thursday by the U.S.-based Pew Research Center.

But Mattis portrayed U.S.-Mexican military ties as strong, saying both countries shared common concerns about issues that include drug trafficking in Mexico but also drug consumption in the United States that fuels the illicit industry.

Asked how he would navigate the political tensions, Mattis said: “We have shared security concerns. There’s partnerships, military-to-military exchanges, that are based on trust and respect.”

“I’m going down to build the trust and show the respect on their Independence Day,” Mattis said.

He stayed above the political fray when asked about the most contentious issues between the two countries. Questioned about his role in the border wall issue, Mattis said there was no U.S. military role in enforcing the borders.

The New York Times quoted Trump’s chief of staff, John Kelly, suggesting Mexico was on the verge of collapse and comparing it to Venezuela under former President Huge Chavez.

Asked whether he thought Mexico was on the verge of collapse, Mattis said flatly: “No.”

“Every nation has its challenges it deals with. And Mexico is keenly aware of these and I’m there to support them in dealing with them,” Mattis said.

Mattis also said he would also “absolutely” express condolences for Mexican victims of a recent earthquake that struck the country, killing 96 people.

Mexico is also hosting Admiral John Richardson, Chief of Naval Operations, the Navy’s highest uniformed officer, and General Lori Robinson, the head of U.S. Northern Command, for its Independence Day activities.

Mattis is the first U.S. defense secretary to attend the events.

Although Mexico’s official Independence Day is on Sept. 16, most celebrations take place on Sept. 15. The event commemorates the launch of Mexico’s war of independence from Spain in 1810.

The fact that such senior U.S. military officials would be visiting for such an important national event is itself notable.

Mexicans have a long memory of the Mexican-American War of 1846-1848, which led to Mexico’s loss of almost half its territory to the United States. The war has made U.S.-Mexican military cooperation a somewhat sensitive subject in Mexico.

In an apparent nod to Mexican sensitivities, Mattis called the ties between the two militaries “very strong, quiet.”

There are signs of improving U.S.-Mexican cooperation in cracking down on the heroin trade.

Reuters reported in April that Mexico’s army was allowing the United States and the United Nations to observe opium poppy eradication.

The Mexican army took U.S. military officials on helicopter tours of half a dozen sites in Sinaloa and Chihuahua, two of the three states that along with Durango make up the Golden Triangle where most Mexican opium is produced, one of the sources said at the time.