The US Defence Secretary James Mattis has said any use of nuclear weapons by North Korea would be met with an "effective and overwhelming" response.
Mr Mattis spoke in South Korea, where he had been reaffirming US support, before flying to Tokyo.
He also reconfirmed plans to deploy a US missile defence system in South Korea later this year.
North Korea's repeated missile and nuclear tests and aggressive statements continue to alarm and anger the region.
The US has a considerable military presence in South Korea and Japan, as part of a post-war defence deal. There are just under 28,500 US troops in the country, for which Seoul pays about $900m (£710m) annually.
President Donald Trump has previously said he wants both South Korea and Japan to pay more towards maintaining that presence.
Mr Mattis used his visit to reassure South Korea that the Trump administration "remains steadfast" in its "iron-clad" defence commitments to the region, said the Pentagon.
Speaking after talks at the defence ministry with his South Korean counterpart Han Min-koo, Mr Mattis told reporters that "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".
North Korea conducted its fifth test of a nuclear device last year, and claims it is capable of carrying out a nuclear attack on the US, though experts are still unconvinced its technology has progressed that far.
It has also said in recent weeks that it has a new intercontinental ballistic missile, capable of reaching the US mainland, which it is prepared to test launch at any time.
Mr Mattis's assertion that an attack by North Korea would get massive retaliation will hardly be a revelation to Kim Jong-un, says the BBC's Stephen Evans in Seoul.
The bigger question is whether to talk to the North Korean leader to try to persuade him to abandon or limit the size of his nuclear arsenal, our correspondent adds. On that, the Trump administration has so far been silent.
Under the Obama administration, the US and South Korea agreed to deploy a US-made Terminal High Altitude Area Defense (THAAD) missile defence system in South Korea.
Its supporters say it is aimed solely at defending from North Korean threats. But China and Russia have complained it is provocative.
Beijing says it goes "far beyond the defence needs of the Korean peninsula". It believes the system's radar would allow the US to spy on its military.
It is also unpopular with some South Koreans, who fear missile bases could become targets and endanger people who live nearby.
Speaking on Thursday, Mr Mattis sought to reassure China, saying there was "no other nation that needs to be concerned about THAAD other than North Korea".
A Chinese foreign ministry spokesman said on Friday that Beijing remained firmly opposed to the deployment of the missile system.
After his meetings in Seoul Mr Mattis flew to Japan, where there are a further 50,000 US soldiers plus their dependants and support staff in Japan. The US paid about $5.5bn for its Japanese bases in 2016, with Japan paying a further $4bn.
Mr Mattis told Japanese Prime Minister Shinzo Abe that the US remained committed to the military alliance between their countries.
The mutual defence treaty was "as real to us today as it was a year ago, five years ago and it will be a year and 10 years from now", he said.
According to Japanese media, he also confirmed that the US would defend islands in the East China Sea that are controlled by Japan but claimed by Beijing.