By Agence France-Presse
No North Korean missile had overflown Japan for years, and the launch came after a strained period on the peninsula following Pyongyang's testing of two intercontinental ballistic missiles (ICBMs) last month that appeared to bring much of the US mainland within reach.
It threatened to fire a salvo of missiles towards the US territory of Guam, while US President Donald Trump issued an apocalyptic warning of raining "fire and fury" on the North, saying Washington's weapons were "locked and loaded".
The United Nations Security Council imposed a seventh set of sanctions on the Pyongyang, tightening restrictions on its exports, and investments into the North.
Tensions had eased more recently, but the South's Joint Chiefs of Staff said in a statement that Tuesday's missile was launched at around 2057 GMT Monday from Sunan, near Pyongyang, travelling east "and over Japan".
It flew around 2,700 kilometres (1,700 miles) at a maximum altitude of around 550 kilometres, it said, adding South Korea and the US were "closely analysing for more details".
Guam is around 3,500 kilometres from North Korea -- although the missile appeared to have been fired in a westerly direction and not towards the US outpost, home to about 160,000 people and host to major military facilities.
Tokyo also said the missile overflew the country's northernmost island Hokkaido, with Prime Minister Shinzo Abe saying the government would take "full steps" to ensure the safety of the Japanese people.
"Their outrageous act of firing a missile over our country is an unprecedented, serious and grave threat and greatly damages regional peace and security," he told reporters.
The US confirmed the launch and the overflight of Japan, with Pentagon spokesman Colonel Rob Manning saying the North American Aerospace Defense Command (NORAD) determined it "did not pose a threat to North America".
The firing comes days after Pyongyang launched three short-range missiles in what analysts said was seen as a minimal provocation after the start of the Ulchi Freedom Guardian South Korean-US joint military exercise.
The North, which says it needs nuclear weapons to protect itself, sees the drills as rehearsals for invasion.
But Tuesday's flight path represents a significant escalation by Pyongyang.
When it carried out its ICBM tests last month -- which leader Kim Jong-Un described as a "gift" to "American bastards" -- it fired them on lofted trajectories that avoided travelling over Japan.
But any launch towards Guam would have to pass over the Asian island nation.
The last time a North Korean rocket did so was in 2009, when Pyongyang said it was launching a telecommunications satellite, but Washington, Seoul and Tokyo believed it was a clandestine ICBM test.
When the North sent a missile into Japan's exclusive economic zone -- waters extending 200 nautical miles from its coast -- last year it only triggered protests and anger.
It has carried out several similar launches since then.
"Today is really quite a horrible day for Japan," security commentator Ankit Panda said on Twitter following Tuesday's overflight.
"If North Korea assesses the costs of overflying Japan to be *anything* but intolerable, we'll see more of these kinds of tests."
Japan has in the past vowed to shoot down North Korean missiles or rockets that threaten to hit its territory, and deployed its Patriot missile defence system in response to the Guam threat, reports and officials said, with an Aegis destroyer also stationed in the Sea of Japan (East Sea).
In Seoul, President Moon Jae-In was to attend an emergency meeting of the National Security Council, the presidential office said.
"Our military has bolstered deterrence against additional provocations by the North Korean military and is closely monitoring related movements with full military readiness," the South's Joint Chiefs of Staff said.