In comments posted on his official Twitter account, he wrote: "I thank God for this blessing & bow to the greatness of the patient nation of Iran. Congrats on this glorious victory!"
Rouhani had staked his presidency on the nuclear talks, deepening the diplomacy which involved Britain, China, France, Russia and the United States plus Germany, after taking office in August 2013.
Signup to our newsletter and follow us on Facebook and Twitter!
Only last week he said Iranians should look forward to a "year of prosperity" after sanctions are lifted.
"The government is running the country under sanctions not under normal circumstances. God willing, in the coming days we will witness a rolling up of the sanctions scroll in this country," he said.
On the back of the nuclear deal, Rouhani wants to make greater inroads in domestic policy, with even modest social and political reforms in the Islamic republic.
But he has faced criticism from hardline groups about the nuclear accord, with opponents warning it could lead to "infiltration" by the United States in Iran's economy and other arenas.