Iranian President Hassan Rouhani on Tuesday declared "victory" over the Islamic State group in Iraq and Syria as the jihadists cling to just a few remaining scraps of territory.
Iran is one of the main international backers of Syrian President Bashar al-Assad and has sent military advisers and thousands of "volunteers" to fight IS on the ground in Syria and Iraq.
In a televised speech Rouhani thanked "all the fighters of Islam", supreme leader Ayatollah Ali Khamenei and the armed forces of Iraq and Syria for "the end of this group that brought nothing but evil, destruction, murder and savagery".
He congratulated Iran's Revolutionary Guards and its foreign arm the Quds Force for a "great victory" but insisted that the "main work was accomplished by the people and armies of Syria, Iraq and Lebanon".
"We helped them in accordance with our religious and Islamic duties," he said.
Iranian media on Sunday and Monday showed footage of Quds Force commander Qassem Soleimani in the Syrian border town of Albu Kamal, reporting he personally directed operations that recaptured the jihadists' final urban bastion over the weekend.
In a message released by the Revolutionary Guards, Soleimani congratulated supreme leader Khamenei on this "decisive victory" over IS.
"I announce the end of this group," the statement said.
He also hailed the role of Iraq's Hashed al-Shaabi paramilitary coalition -- dominated by groups backed by Tehran -- and the "decisive" role of Lebanon's Iranian-allied Hezbollah movement in the fighting in Syria.
IS jihadists are currently fighting for survival in just a few pockets of remaining territory in Iraq and Syria, after losing the vast bulk of territory they seized in a lightning offensive in 2014.
Neither the Syrian nor Iraqi governments have so far declared definitive victory over the group.