Mexico's foreign relations secretary says his country won't react to U.S. President Donald Trump's threats to close the U.S.-Mexico border.

On Friday, Marcelo Ebrard wrote on Twitter: "Mexico doesn't act based on threats."

He also said the Spanish-speaking country is "the best neighbor" the U.S. could have.

Trump has implied he might close the border between both nations because Mexico isn't doing enough to stop an influx of migrants from Central America.

The Mexican government insists it is cooperating and says immigration is caused by a lack of jobs, a problem which must be addressed through investment.

Ebrard tweeted earlier that it is "acting with responsibility and dignity on the migration issue."