"The fact that North Korea forced through a nuclear test this time is absolutely unacceptable to our country," Prime Minister Shinzo Abe said in a statement.
The North described the test of what it called a hydrogen bomb as a "perfect success".
"North Korea's nuclear and missile development programme is a threat that is more grave and urgent to the safety of our country and has entered a new stage," Abe said.
"Our country lodge a strict protest against North Korea and condemns it in the strongest words," Abe said.
More From This Section
The explosion came just hours after Pyongyang claimed to have developed a hydrogen bomb that could be loaded onto a long-range missile, and after Abe held telephone talks with US President Donald Trump on the North's weapons programmes.
"The government confirms that North Korea conducted a nuclear test after examining information from the weather agency and other information," Japanese Foreign Minister Taro Kono told reporters.
Defence Minister Itsunori Onodera said the ministry has begun flying "sniffer" planes capable of detecting radioactive fallout.