Hadi al-Ameri, a former minister who commands the Badr militia, said support from Iran and General Qassem Suleimani had been crucial after Iraqi government forces collapsed in the face of the IS assault.
"If it were not for the cooperation of the Islamic republic of Iran and General Suleimani, we would not today have a government headed by Haider al-Abadi in Baghdad," Ameri told a memorial service south of Tehran Monday for an Iranian officer killed in Iraq last month.
"It would not have existed," he said of the Iraqi government, according to the Isna and Fars news agencies.
The memorial was for Iranian Revolutionary Guards Major General Hamid Taghavi, killed by IS fighters in the Iraqi city of Samarra last month.
Suleimani, the commander of Iran's Quds Force -- the foreign wing of the Revolutionary Guards -- was also present at the memorial.
Signup to our newsletter and follow us on Facebook and Twitter!
The general, who reportedly landed in Baghdad hours after IS overran the Iraqi city of Mosul in June and led the anti-jihadist counter-attack, has become the public face of Iran's deep military involvement in Iraq.
Abadi took over as Iraq's prime minister after Nuri al-Maliki, a fellow Shiite with close ties to Tehran, reluctantly stood down following the IS surge into northern Iraq.
Iran moved swiftly by arming Iraqi Kurdish fighters and supporting Baghdad with military advisers. It has also provided training for Shiite militias in a counter-offensive against the Sunni extremist group.
But Tehran has consistently denied having troops on the ground and was never invited to join the US-led military coalition that is carrying out air strikes against IS in Syria and Iraq.
Predominantly Shiite Iran has a strong interest in defending Iraq, where IS's declared aim is to topple a regime dominated by Shiites, who are regarded by the jihadists as heretics.