"It is much more important for us to abide by this decree than the articles of the Non-Proliferation Treaty and its additional protocol," Rowhani said in a meeting with Danish Foreign Minister Per Stig Moeller on Monday.
According to Rowhani, Ayatollah Ali Khamenei's fatwa forbids the production, stockpiling and use of nuclear weapons.
A top figure in the Islamic Republic, Rowhani is not the first official to have cited this decree, the text of which has never been made public.
The supreme leader has the power at all times to issue religious decrees, which have the force of law.
Iran has always pledged to meet its international commitments.
Rowhani stressed the "merely peaceful nature" of Iran's nuclear activities and said "our main concern in our talks with the Europeans is building trust".
"We are fully aware that moving towards acquiring atomic weapons equals losing the international community's trust as well as a serious obstacle on the way to development of our country," he said.
Iran has been negotiating since December with Britain, France and Germany to win EU trade, security and technology rewards in return for giving guarantees that it is not trying to develop nuclear weapons.
Iran agreed in November to suspend enrichment activities as a goodwill gesture for a maximum of six months, but the Europeans want the suspension to become permanent. The Iranians call that demand "absurd".
The negotiations are to resume on April 19.