Japan condemned US President Donald Trump for comparing recent US strikes on Iran to the bombing of Hiroshima and Nagasaki that ended World War II.

"That hit ended the war," Trump told reporters on Wednesday. "I don't want to use an example of Hiroshima, I don't want to use an example of Nagasaki, but that was essentially the same thing."

About 140,000 people died when the US dropped atomic bombs on the two southern Japanese cities in August 1945. Survivors live with psychological trauma and heightened cancer risk to this day.

If Trump's comments "justifies the dropping of the atomic bomb, it is extremely regrettable for us as a city that was bombed," said Nagasaki Mayor Shiro Suzuki.

Trump's comments are "unacceptable", said Mimaki Toshiyuki, an atomic bomb survivor who co-chairs the Nobel Peace Prize-winning advocacy group Nihon Hidankyo, according to public broadcaster NHK.