An emboldened Mexico hardened its opposition to President Donald Trump on Friday by saying it would retaliate if the United States imposed a border tax and that it can afford to lose financial aid that might be pulled to pay for a border wall.

Foreign Minister Luis Videgaray said Mexico could respond to any tax the United States were to unilaterally impose on imports from its southern neighbour to finance the wall with levies on select goods, aimed at U.S. regions most dependent on exports south of the border.

"Without a doubt, we have that possibility, and what we cannot do is remain with our arms crossed," Videgaray said in a radio interview. "The Mexican government would have to respond."

The statements by Videgaray and Interior Minister Miguel Angel Osorio Chong, who minimised the potential impact of the rumoured loss of U.S. security aid, toughened the defiant tone from Mexico since President Enrique Pena Nieto last month canceled a trip to meet Trump over the wall dispute.