Mexico on Thursday dismissed a claim by U.S. President Donald Trump that it was the most dangerous country in the world and reiterated it would not fund the construction of a wall along the U.S. southern border.

In a series of Twitter posts touching on NAFTA trade negotiations and security, Trump described Mexico as 'the number one most dangerous country in the world,' an assertion that was quickly rebuffed by Mexico's foreign ministry.

'Even though Mexico has a significant problem with violence, it is plainly false that Mexico is the most dangerous country in the world,' the ministry said in a statement.

In the year through November, a total of 23,101 murder investigations were opened in Mexico, giving the highest annual figure since records began in 1997.

President Donald Trump claimed Thursday that he needs a border wall because crime in Mexico has made it 'the number one most dangerous country in the world,' a claim the Mexican government quickly disputed

It's unclear what Trump was basing his claim on; at least nine other nations have higher per capita homicide numbers

in terms of raw murder numbers, Mexico is a hot spot: in the year ending November 2017, a total of 23,101 murder investigations were opened there

The president has long pledged to erect a wall along large portions of the U.S.-Mexico border, and a set of eight prototypes went up last fall in southern California

That was a murder rate of 18.7 per 100,000 inhabitants, well below levels in Latin American countries such as Brazil, Colombia, Venezuela, Honduras and El Salvador, according to U.N. figures used in the World Bank's online database for 2015, the last year for which results are available.

Looking ahead to talks later this month to rework the North American Free Trade Agreement (NAFTA), the ministry said the country would put its national interest first, while seeking an outcome to benefit all countries in the pact.

Trump has suggested that Mexico could finance construction of the wall indirectly through changes to NAFTA.

'If there is no Wall, there is no Deal!' Trump wrote on Thursday, without specifying which deal he was referring to.

Murder rates throughout the world Top rates of 'intentional homicide,' per 100,000 inhabitants, in 2015: El Salvador – 108.6 Honduras – 63.8 Venezuela – 57.1 Jamaica – 43.2 South Africa – 34.3 Trinidad and Tobago – 30.9 Brazil – 26.7 Colombia – 26.5 Guyana – 19.4 Mexico – 16.3 Source: The World Bank Advertisement

Earlier in the day Trump tweeted: 'The Wall will be paid for, directly or indirectly, or through longer term reimbursement, by Mexico, which has a ridiculous $71 billion dollar trade surplus with the U.S.'

'The $20 billion dollar Wall is "peanuts" compared to what Mexico makes from the U.S. NAFTA is a bad joke!'

Mexico's foreign ministry batted away the Twitter salvos.

'Mexico will not negotiate NAFTA, nor any other aspect of the bilateral relationship, through social networks or the media,' it said in its statement.