"Why has North Korea chosen this path today which has worried people in East Asia? It is because of threats against North Korea's existence," Rouhani said in a speech to his cabinet shown on state television.
"Can one joke around with atomic weapons? When a country has obtained an atomic weapon, then the game of threatening them becomes a dangerous game for the entire world," he added.
"We believe this issue must be resolved through negotiations and dialogue."
Rouhani said US officials needed to tone down their rhetoric.
"Leave them be. Don't threaten North Korea so much, and she will pursue her life and that of her people," he said.