"For the government and the people of Iran, Qom is not a city, but the symbol of religious life," Rouhani, who faces criticism on the home front, said in a speech in the Shiite holy city of Qom.
At the heart of the Shia faith in Iran, Qom's seminary hosts about 80,000 religious students, some from abroad.
"I want to make clear that the government needs Qom" with its clergy forming the "backbone" of Iran, he said, stressing the seminary's independence would "never be compromised under the banner of a policy, a party or faction."
Rouhani, himself a middle-ranking clergy, is often criticised by ultraconservatives over his cultural and political openness, as well as being accused of making too many concessions in nuclear talks with world powers.
The timing of his Qom visit, as nuclear negotiations enter the final stage, "can be seen as an effort to gain the support of religious leaders for a possible agreement", reformist daily Shargh said.
Signup to our newsletter and follow us on Facebook and Twitter!
It said Rouhani, a reputed moderate, "knows that having the consent of religious leaders from Qom can help him push forward his policies and keep his election promises".
EU foreign policy chief Federica Mogherini said Tuesday that a deal between Tehran and world powers on Iran's controversial nuclear programme was "at hand", ahead of a new round of talks scheduled in Geneva next week.
They have a March 31 deadline looms reaching a political framework for a deal.
The so-called P5+1 group of Britain, China, France, Russia, the United States and Germany are trying to strike an accord that would prevent Tehran from developing a nuclear bomb.
In return, the West would ease punishing sanctions imposed on Tehran over its nuclear program, which Iran insists is purely civilian.