North Korea test-fired an intercontinental ballistic missile that flew 621 miles toward Japan before falling in the water, South Korea said.