General Joseph Dunford (L)

The United States' most senior military officer on Friday said North Korea understands that an any attack on Japan is equal to one on the US itself -- and vice versa.

General Joe Dunford, chairman of the Joint Chiefs of Staff, held talks with his Japanese counterpart at the defence ministry in Tokyo, wrapping up a regional tour during heightened tensions with North Korea.

Tokyo remains on alert against potential military provocations by Pyongyang after North Korea threatened to fire missiles towards the Pacific island of Guam, US territory, which would have flown over Japan.

"I think we made it clear to North Korea and anyone else in the region that an attack on one is an attack on both of us," Dunford told Katsutoshi Kawano, Chief of Staff of Japan's Self-Defence Forces.

"And that's very, very important for deterrence," added Dunford, who visited South Korea and China before arriving in Japan.

Dunford added that the US reaffirmed its "ironclad commitment" to the security of Japan on Thursday when Defense Secretary Jim Mattis and Secretary of State Rex Tillerson held talks with their Japanese counterparts in Washington.

Japan frequently demands -- and receives -- US reassurances over its commitment to defend its ally.

The US and Japan, adversaries in World War II, have forged a decades-long defence alliance and the US stations tens of thousands of troops in the country.

Washington has long encouraged Japan to take on more defence responsibility even though the country is militarily constrained by a US-written constitution imposed after the end of World War II. 

In 2015 nationalist Prime Minister Shinzo Abe pushed contentious security bills through parliament that expand what Japan can do to help its ally, such as coming to the aid of US troops under attack.

Dunford is scheduled to hold talks with Prime Minister Shinzo Abe later in the day.

During his visit to China, Dunford said peace with North Korea is a "possibility", but warned the US has "credible, viable military options" for dealing with the errant regime.

The US and North Korea have been engaged in heated verbal sparring since Trump warned Pyongyang that it faced "fire and fury" if it continued to threaten the US and other countries with its nuclear weapons and ballistic missiles.

North Korea responded that it was ready to aim a missile at the American territory Guam, an operation that has since been suspended.