President Barack Obama has condemned North Korea's third nuclear test, calling it a "highly provocative act" that threatens national security and "undermines regional stability."