Mexicos foreign minister has warned the United States that his country will impose tariffs on US products if President Donald Trump taxes Mexican imports to finance a border wall.

"If Mexico is faced with this as a reality, not a rhetorical threat... the Mexican government will have to respond," Foreign Minister Luis Videgaray told Radio Formula on Friday.

"The answer would not be to impose a general tax on all imports coming from the United States, because that would hurt the Mexican consumer... we would do it selectively."

The neighboring countries face the biggest diplomatic rift in decades over Trump's insistence that Mexico pay for construction of a wall along their 2,000-mile (3,200-kilometer) border.

Mexican President Enrique Pena Nieto's government has expressed strong opposition to any such move.

Videgaray noted that if Trump places tariffs on Mexican goods, it would hit US households that buy all sorts of products from south of the border, including avocados, cars, phones and appliances.

The Mexican top diplomat said his country is open to discussion on "some aspects" of Trump's promise to renegotiate the North American Free Trade Agreement (NAFTA) between Canada, Mexico and the United States, but that his country will not accept imposed tariffs.

Pena Nieto canceled a planned meeting with Trump in Washington last month over the US leader's vow to make Mexico pay for the wall.

US Homeland Security Secretary John Kelly and Secretary of State Rex Tillerson visited Mexico on Thursday where they met with Pena Nieto, Videgaray and other officials in an attempt to mend frayed ties.