Forget reaching the US mainland, one errant North Korean missile went rogue last year and crashed into a city not far from the capital, Pyongyang, according to a report.

A Hwasong-12 intermediate-range ballistic missile turned itself into a very-short-range rocket when it failed during a test flight on April 28, 2017, and slammed into the city of Tokchon, according to The Diplomat magazine.

The missile, which was launched from the Pukchang airfield, flew just 24 miles before taking a nosedive and striking a complex of industrial or agricultural buildings, the mag reported.

According to a US government source with knowledge of the hermit kingdom’s weapons program, the missile’s first-stage engines failed after about a minute of flight.

The location of the missile’s impact was revealed exclusively to The Diplomat, which said it corroborated the flub using commercially available satellite imagery from April and May 2017.

Although the images show that the explosion caused heavy damage in the heavily populated area, there is no way to tell if it led to casualties.

Had the missile successfully completed its test flight, it would have landed in the northern part of the Sea of Japan, near the Russian coast.

Various media outlets around the world reported about the failed test — the third involving the Hwasong-12 — at the time, but details about where the missile fell remained a mystery until now.

Fearing such a flop, North Korean despot Kim Jong Un chose the remote seaside resort town of Sinpo as the test site of the first two failed launches in April.

The reclusive regime now uses several new test sites, including Pyongyang’s Sunan Airport, which also serves as the country’s civil aviation hub and entry point for most non-Chinese visitors, according to the International Business Times.

Despite several failures, a Hwasong-12 was successfully test launched on May 14 — leading the way for the introduction of the Hwasong-14/KN20 intercontinental ballistic missile.

North Korea’s aggressive missile testing ratcheted up tensions between Pyongyang and Washington.

During a televised speech, Kim declared: “The United States can never fight a war against me and our state. It should properly know that the whole territory of the US is within the range of our nuclear strike and a nuclear button is always on the desk of my office, and this is just a reality, not a threat.”

President Trump upped the ante when he fired back with a threatening tweet.

“North Korean Leader Kim Jong Un just stated that the ‘Nuclear Button is on his desk at all times.’ Will someone from his depleted and food starved regime please inform him that I too have a Nuclear Button, but it is a much bigger & more powerful one than his, and my Button works!” he wrote.