You are not permitted to download, save or email this image. Visit image gallery to purchase the image.
The test, one of the most provocative ever from the reclusive state, came as United States and South Korean forces conduct annual military exercises on the peninsula, to which North Korea strenuously objects.
North Korea has conducted dozens of ballistic missile tests under young leader Kim Jong Un - the most recent on Saturday - but firing projectiles over mainland Japan is rare.
"North Korea's reckless action is an unprecedented, serious and a grave threat to our nation," Japanese Prime Minister Shinzo Abe told reporters.
Abe said he spoke to US President Donald Trump on Tuesday and they agreed to increase pressure on North Korea. Trump also said the United States was "100 percent with Japan", Abe told reporters.
South Korea's military said the missile was launched from near the North Korean capital, Pyongyang, just before 6am (local time) and flew 2700km, reaching an altitude of about 550km.
Four South Korean fighter jets bombed a military firing range on Tuesday after President Moon Jae-in asked the military to demonstrate capabilities to counter North Korea.
South Korea and the United States had discussed deploying additional "strategic assets" on the Korean peninsula, the presidential Blue House said in a statement, without giving more details.
North Korea remained defiant.
"The US should know that it can neither browbeat the DPRK with any economic sanctions and military threats and blackmail nor make the DPRK flinch from the road chosen by itself," North Korea's official Rodong Sinmun said later on Tuesday, using the initials of the North's official name, the Democratic People's Republic of Korea.
This month, North Korea threatened to fire four missiles into the sea near the US Pacific territory of Guam after Trump said it would face "fire and fury" if it threatened the US.
"Alas, Pyongyang has demonstrated that its threats to the US base on Guam are not a bluff," Konstantin Kosachev, chairman of Russia's upper house of parliament's international affairs committee, said on social media.
North Korea fired what it said was a rocket carrying a communications satellite into orbit over Japan in 2009 after warning of its plan. The United States, Japan and South Korea considered it a ballistic missile test.
Japan's Chief Cabinet Secretary Yoshihide Suga said the latest missile fell into the sea 1180km east of Cape Erimo on Hokkaido.
Television and radio broadcasters broke into their regular programming with a "J-Alert" warning citizens of the missile launch. Bullet train services were temporarily halted and warnings went out over loudspeakers in towns in Hokkaido.
"I was woken by the missile alert on my cellphone," said Ayaka Nishijima (41), an office worker on Honshu island.
"I didn't feel prepared at all. Even if we get these alerts there's nowhere to run. It's not like we have a basement or bomb shelter, all we can do is get away from the window," she told Reuters by text message.
The United Nations Security Council would meet later on Tuesday to discuss the test, diplomats said.
This month, the 15-member Security Council unanimously imposed new sanctions on North Korea in response to two long-range missile launches in July.