Jim Mattis and Han Min Koo
Defense Secretary Jim Mattis warned North Korea against using nuclear weapons on the U.S. and its allies. In this photo, Mattis (left) shakes hands with South Korean Defense Minister Han Min-Koo before their meeting at the Defense headquarters in Seoul, Feb. 3, 2017. REUTERS/Kim Min-Hee/Pool

North Korea’s use of nuclear weapons on the U.S. or its allies will meet with “overwhelming” and “effective” response from Washington, the U.S. Defense Secretary James Mattis said Friday. His warning comes at a time when Pyongyang threatened to test-fire an intercontinental ballistic missile (ICBM) — capable of reaching mainland U.S. — from anywhere and at any time.

"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," Mattis said at the South Korean defense ministry, at the end of a two-day visit."North Korea continues to launch missiles, develop its nuclear weapons program and engage in threatening rhetoric and behavior."

South Korean Defense Minister Han Min Koo said Mattis' visit sent strong message of Washington’s backing.

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

Last month, the North Korean foreign ministry said the country was ready to launch a ballistic missile. It also said that the isolated nation developed the ICBM to boost its self-defense capabilities and to counter “the ever more undisguised nuclear war threat from the U.S.”

Last year, the Kim Jong Un-led country conducted series of missile launches nuclear tests — including a hydrogen bomb test.

The U.S. has sizeable military in South Korea and in July 2016, the two allies agreed to deploy Terminal High Altitude Area Defense (THAAD) missile system. On his visit to South Korea, Mattis on Thursday reaffirmed Washington’s stance on the deployment.

“THAAD is for defense of our allies' people, of our troops, who are committed to their defense and were it not for the provocative behavior of North Korea we would have no need for THAAD out here,” Mattis said during his first official trip overseas.

The defense secretary also sought to assure China — who has strongly opposed THAAD installment — saying “there is no other nation that needs to be concerned about THAAD other than North Korea.”

However, Chinese foreign ministry reportedly said Friday that Beijing remained opposed to THAAD deployment.