The missile was launched around 7:55 am (2255 GMT Saturday) from Banghyon air base in the western province of North Pyongan.
Prime Minister Shinzo Abe, whose country would be in range of a hostile North, called the launch "absolutely intolerable". South Korea said Pyongyang was testing Trump.
The missile was launched around 7:55 am (2255 GMT Saturday) from Banghyon air base in the western province of North Pyongan, and flew east towards the Sea of Japan (East Sea), the South's defence ministry said.
It flew about 500 kilometres (310 miles) before falling into the sea, a ministry spokesman said, adding the exact type of missile had yet to be identified.
"Today's missile launch... is aimed at drawing global attention to the North by boasting its nuclear and missile capabilities", the ministry said in a statement.
"It is also believed that it was an armed provocation to test the response from the new US administration under President Trump," it added.
The US Strategic Command said it detected and tracked what it assessed to be a medium-range ballistic missile
It was the first such test since last October.
Trump responded with an assurance to the visiting Abe that Washington was committed to the security of its key Asian ally.
"I just want everybody to understand and fully know that the United States of America stands behind Japan, its great ally, 100 percent," he said, without elaborating.
Abe denounced the launch as "absolutely intolerable" while top government spokesman Yoshihide Suge told reporters in Tokyo it was "clearly a provocation to Japan and the region".
North Korea is barred under UN resolutions from any use of ballistic missile technology. But six sets of UN sanctions since Pyongyang's first nuclear test in 2006 have failed to halt its drive for what it insists are defensive weapons.
Last year the country conducted two nuclear tests and numerous missile launches in its quest to develop a nuclear weapons system capable of hitting the US mainland.
A South Korean army official quoted by Yonhap news agency ruled out the possibility of a long-range missile test, describing the device as an upgraded version of the North's Rodong missile.
Seoul-based academic Yang Moo-Jin said the latest test was "a celebratory launch" to mark the February 16 birthday of Kim Jong-Il, late ruler and father of current leader Kim Jong-Un.
Pyongyang often celebrates key anniversaries involving current and former leaders with missile launches, Yang, a professor at the University of North Korean Studies, told AFP.
South Korea's acting president Hwang Gyo-Ahn vowed a "corresponding punishment" in response to the launch, which came on the heels of a visit to Seoul by US Defense Secretary James Mattis this month.
Mattis had warned Pyongyang that any nuclear attack would be met with an "effective and overwhelming" response.
Trump's national security adviser Michael Flynn, spoke to his South Korean counterpart Kim Kwan-Jin by phone and agreed to "seek all possible options" to curb future provocations by the North, Seoul's presidential office said.
Australian Prime Minister Malcolm Turnbull also condemned the launch as a "further threat to regional... peace and stability" and vowed to work with Beijing, Seoul and Tokyo to heap pressure on Pyongyang.
In January leader Kim Jong-Un boasted that Pyongyang was in the "final stages" of developing an intercontinental ballistic missile (ICBM) in an apparent attempt to pressure the incoming US president. Trump shot back on Twitter, saying "It won't happen."
James Char, senior analyst at the Institute of Defence and Strategic Studies in Singapore, said the launch was Pyongyang's "way of showing characteristic defiance against... Trump".
The latest launch poses a test for Trump, who will need the help of the North's closest ally China to deal with the reclusive state.
Relations have thawed in recent days after Trump reaffirmed Washington's "One China" policy in what he described as a "very warm" telephone conversation with President Xi Jinping.
But all agree it has made enormous strides in that direction since Kim took over after the death of his father in December 2011.