“Today with God’s guidance and the resistance of people in the region we can say that this evil has either been lifted from the head of the people or has been reduced,” Rouhani said in an address broadcast live on state TV.
“Of course the remnants will continue but the foundation and roots have been destroyed.”
Major General Qassem Soleimani, a senior commander of the elite Revolutionary Guards, also said Daesh had been defeated, in a message sent on Tuesday to Iran’s supreme leader which was published on the Guards’ news site, Sepah News.
Iranian media have often carried video and pictures of Soleimani, who commands the Quds Force, the branch of the Guards responsible for operations outside Iran, at frontline positions in battles against Daesh in Iraq and Syria.
The Revolutionary Guards, a powerful military force which also oversees an economic empire worth billions of dollars, has been fighting in support of Syrian president Bashar Assad and the central government in Baghdad for several years.
More than a thousand members of the Guards, including senior commanders, have been killed in Syria and Iraq.
The Syrian conflict has entered a new phase with the capture at the weekend by government forces and their allies of Albu Kamal, the last significant town in Syria held by Daesh, where Soleimani was pictured by Iranian media last week.
Iraqi forces captured the border town of Rawa, the last remaining town there under Daesh control, on Friday, signalling the collapse of the so-called caliphate it proclaimed in 2014 across vast swathes of Iraqi and Syrian territory.
Most of the forces battling Daesh in Syria and Iraq have said they expect it to go underground and turn to a guerrilla insurgency using sleeper cells and bombings.
In his address on Tuesday, Rouhani accused the United States and Israel of supporting Daesh. He also criticized Arab powers in the region and asked why they had not spoken out about civilian deaths in Yemen’s conflict.
The foreign ministers of Saudi Arabia and other Arab states criticized Iran and its Lebanese Shiite ally Hezbollah at an emergency meeting in Cairo on Sunday, calling for a united front to counter Iranian interference.
Soleimani acknowledged the multinational force Iran has helped organize in the fight against Daesh and thanked the “thousands of martyrs and wounded Iranian, Iraqi, Syrian, Afghan and Pakistani defenders of the shrine.”
He pointed to the “decisive role” played by Hezbollah and the group’s leader Seyed Hassan Nasrallah and highlighted the thousands of Iraqi Shiite volunteers, known as the Popular Mobilization Forces, who have fought Daesh in Iraq.
On websites linked to the Guards, members of the organization killed in Syria and Iraq are praised as protectors of Shiite holy sites and labelled “defenders of the shrine.”
Rouhani is scheduled to meet Russian President Vladimir Putin and Turkish leader Tayyip Erdogan in Russia on Wednesday to discuss the Syria conflict.
The Revolutionary Guards initially kept quiet about their military role in both Syria and Iraq but have become more outspoken about it as casualties have mounted. They frame their engagement as an existential struggle against the Sunni Muslim fighters of Daesh, who see Shiites, the majority of Iran’s population, as apostates.
Last month, US President Donald Trump gave the US Treasury Department authority to impose economic sanctions on Guards members in response to what Washington calls its efforts to destabilize and undermine its opponents in the Middle East.