The launch, from near Pyongyang, came after the United Nations Security Council imposed an eighth set of measures on the isolated country over its ballistic missile and atomic weapons programmes.
That followed its sixth nuclear test - by far its largest yet - earlier this month, which Pyongyang said was a hydrogen bomb small enough to fit onto a missile.
In New York, the Security Council called an emergency meeting for later on Friday.
The US Pacific Command confirmed Friday’s rocket was an intermediate range ballistic missile (IRBM) and said it did not pose a threat to North America, or to the US Pacific territory of Guam, which Pyongyang has threatened to bracket with "enveloping fire".
Seoul’s defence ministry said it probably travelled around 3,700 kilometres and reached a maximum altitude of 770 kilometres.
It was "the furthest overground any of their ballistic missiles has ever travelled", Joseph Dempsey of the International Institute for Strategic Studies said on Twitter.
It was a "clear indication North Korea has range - not necessarily accuracy - to follow through (the) Guam plan", he added.
The North has raised global tensions with its rapid progress in weapons technology.
The North’s last missile launch, a Hwasong-12 IRBM just over two weeks ago, also overflew Japan’s main islands and was the first to do so for years.
But when Pyongyang tested two intercontinental ballistic missiles in July that appeared to bring much of the US mainland into range, it fired them on lofted trajectories that avoided passing over the archipelago nation.
"The North is sending a message which is, ’we are not cowering before any sanctions and our warnings are not empty threats’," Yang Moo-Jin of the University of North Korean Studies in Seoul said.
Millions of Japanese were jolted awake by blaring sirens and emergency text message alerts after the missile was fired.
Japanese Prime Minister Shinzo Abe said Tokyo could "never tolerate" what he called a "dangerous provocative action that threatens world peace".
Tokyo had protested to Pyongyang in the "strongest words possible", chief government spokesman Yoshihide Suga added.
The missile overflew Japan for around two minutes, reports said, but there were no immediate indications of objects falling onto Japanese territory.
Oil shipments
South Korea’s military immediately carried out a ballistic missile drill of its own on Friday in the East Sea, Korea’s name for the Sea of Japan, the defence ministry said.
The Hyunmu missile travelled 250 kilometres -- a trajectory intentionally chosen to represent the distance to the launch site at Sunan, near Pyongyang’s airport, it added.
President Moon Jae-In called an emergency meeting of Seoul’s national security council, a standard procedure after the North fires a missile or tests a nuclear device.
The United Nations Security Council sanctions imposed on Monday are the strongest so far, banning the North’s textile trade and imposing restrictions on shipments of oil products, among a series of other measures.
But analysts expect them to do little to dissuade Pyongyang, which says it needs nuclear weapons to defend itself against the threat of invasion by the US.
Earlier this year US President Donald Trump threatened it with "fire and fury", heightening fears of conflict, source from the Vietnamnews.