Tehran: The leaders of Iran and Qatar vowed on Sunday to cooperate to fight “terrorism in the region”, President Hassan Rouhani’s office reported as Iraqi forces counter a militant onslaught.

The pledge to play a “constructive role to establish security and stability” came in a phone call between Qatari Emir Shaikh Tamim Bin Hamad Al Thani and Rouhani, a statement from the Iranian president’s office said.

Rouhani said that in order to defeat “the hurdle of terrorism and extremism ... all Muslims should come hand in hand and cooperate,” it said.

Iran is ready, he said, to do just that and “fight security problems and instability in the region” that benefit only “Zionists and the enemies of the Muslim world”. He did not elaborate.

Predominantly Shiite Iran has vowed to support ally Baghdad against the Sunni insurgency led by the Islamic State (IS), whose fighters have overrun swathes of five Iraqi provinces since launching an offensive in early June.

Iranian leaders insist the Iraq crisis is not sectarian but a fight against terrorism. Iranian media, however, have accused Qatar and Saudi Arabia of supporting the jihadist Sunni fighters.

Without naming anyone, Rouhani himself warned on June 22 that Muslim states which funnel funds to “these savage terrorists” of IS would become their next target.

Sunday’s statement said the Qatari emir noted “the necessity for cooperation between Muslim nations to prevent the further spread of [the Iraqi] crisis in the region”.

“We should all cooperate together against terrorism in the region because the current crisis is very dangerous,” he said.

Qatar’s emir and Iran’s president spoke as thousands of Iraqi troops counter-attacked the militant-held city of Tikrit.