North Korea on Tuesday fired a midrange ballistic missile designed to carry a nuclear payload that flew over Japan and splashed into the northern Pacific Ocean, officials said.