Jim Mattis made the comments in Seoul, where he reassured South Korea of steadfast US support at the end of a two-day visit.

“Any attack on the United States, or our allies, will be defeated, and any use of nuclear weapons would be met with a response that would be effective and overwhelming,” he said, speaking at the country's defence ministry.

Mr Mattis’ remarks come amid concern that North Korea could be preparing to test a new ballistic missile, posing an early challenge to Mr Trump’s administration.

North Korea regularly threatens to destroy South Korea and its main ally the United States. The pariah country conducted more than 20 missile tests last year, as well as two nuclear tests, in defiance of UN resolutions and sanctions.

The North appears to have restarted operation of a reactor at its main Yongbyon nuclear facility that produces plutonium that can be used for its nuclear weapons programme, according to US think tank 38 North.

“North Korea continues to launch missiles, develop its nuclear weapons program and engage in threatening rhetoric and behaviour,” Mr Mattis said.

The United States and South Korea recently agreed to work together to bolster their defences. A US missile defence system, known as Terminal High Altitude Area Defence (THAAD), is expected to be deployed in South Korea later this year.

China, however, has objected to THAAD, saying it will destabilise the regional security balance, leading to calls from some South Korean opposition leaders to delay or cancel it.

But Mr Mattis and his South Korean counterpart reconfirmed their commitment to the project on Friday.

South Korean Defence Minister Han Min-koo said Mr Mattis' visit to Seoul — his first trip abroad as defence secretary — sent a clear message of strong US support.

“Faced with a current severe security situation, Secretary Mattis' visit to Korea ... also communicates the strongest warning to North Korea,” Mr Han said.

North Korea trading despite nuclear sanctions - Inside the country's special economic zone Show all 13 1 /13 North Korea trading despite nuclear sanctions - Inside the country's special economic zone North Korea trading despite nuclear sanctions - Inside the country's special economic zone AP North Korea trading despite nuclear sanctions - Inside the country's special economic zone AP North Korea trading despite nuclear sanctions - Inside the country's special economic zone North Korea trading despite nuclear sanctions - Inside the country's special economic zone AP North Korea trading despite nuclear sanctions - Inside the country's special economic zone AP North Korea trading despite nuclear sanctions - Inside the country's special economic zone AP North Korea trading despite nuclear sanctions - Inside the country's special economic zone AP North Korea trading despite nuclear sanctions - Inside the country's special economic zone AP North Korea trading despite nuclear sanctions - Inside the country's special economic zone AP North Korea trading despite nuclear sanctions - Inside the country's special economic zone AP North Korea trading despite nuclear sanctions - Inside the country's special economic zone AP North Korea trading despite nuclear sanctions - Inside the country's special economic zone AP North Korea trading despite nuclear sanctions - Inside the country's special economic zone AP

Once fully developed, a North Korean intercontinental ballistic missile (ICBM) could threaten the United States, which is about 5,500 miles from North Korea. ICBMs have a minimum range of about 3,400 miles, but some are designed to travel 6,200 miles or more.

Former US officials and other experts have said the United States essentially has two options when it comes to trying to curb North Korea's fast-expanding nuclear and missile programmes - negotiate or take military action.

Neither path offers certain success and the military option is fraught with huge dangers, especially for Japan and South Korea, US allies in close proximity to North Korea.

Mr Mattis is scheduled to depart later on Friday for Japan.