SEOUL—North Korea conducted a fifth nuclear test hours after President Barack Obama wrapped up a tour of Asia, highlighting the U.S.’s struggle to rein in the rising threat from dictator Kim Jong Un.

Pyongyang declared a successful test hours after the U.S. Geological Survey detected a magnitude 5.3 earthquake near North Korea’s nuclear test site in the country’s northeast early on Friday, a reading that surpassed the magnitudes of tremors set off by the country’s previous nuclear tests.

...