Iraqi Prime Minister Haidar al-Abadi, left, meets with Iran's President Hassan Rouhani, at Tehran's Saadabad Palace on Tuesday, Oct. 21, 2014. Rouhani said Iran will stand by its neighbor Iraq in its fight against the Sunni extremists of the Islamic State group and will continue to provide Baghdad with military advisers and weapons, according to a report by the official IRNA news agency. He also criticized the U.S. for allegedly failing to sufficiently support Iraq. (AP Photo/Ebrahim Noroozi)
People look for their loved ones in front of al-Khairat Mosque after a suicide bomber blew himself up among Shiite worshippers after midday prayers as they were leaving the mosque, killing and wounding tens of people, in a commercial area of Baghdad, Iraq, Monday, Oct. 20, 2014. Militants unleashed attacks on Iraq's majority Shiite community on Monday the latest in relentless assaults that have challenged the Shiite-led government as it battles the Sunni-led insurgency by the Islamic State group. (AP Photo/Khalid Mohammed)
Civilians gather at the scene of a car bomb explosion, killing and wounding tens of people, in a commercial area in the southern Shiite holy city of Karbala, 50 miles (80 kilometers) south of Baghdad, Iraq, Monday, Oct. 20, 2014. Militants unleashed attacks on Iraq's majority Shiite community on Monday the latest in relentless assaults that have challenged the Shiite-led government as it battles the Sunni-led insurgency by the Islamic State group. (AP Photo)
TEHRAN, Iran — Shiite powerhouse Iran has pledged enduring support for the Shiite-led government of Iraq in its battle against an ascendant Sunni insurgency spearheaded by the Islamic State group.
Iranian President Hassan Rouhani told visiting Iraqi Prime Minister Haidar al-Abadi on Tuesday that Iran has supported Baghdad "from the first day and will remain on that path until the last day," according to a report by the official IRNA news agency.
It was Abadi's first foreign visit since taking office in September.
"Choosing Iran as my first destination after taking office indicates the depth of ties," he said, according to IRNA. "Terrorism is a threat to all regional countries and we are sure Iran will stand by us."
The Iran-Iraq alliance highlights some of the complex political dynamics spawned by the emergence of the Islamic State group as a major threat earlier this year. The radical Sunni militia has captured and held large swaths of territory in eastern Syria and northwestern Iraq, including the major northern Iraqi city of Mosul, and threatens to expand southward toward Baghdad.
Now both Iran and the United States are essentially on the same side in backing Baghdad and opposing the Islamic State group — although neither country acknowledges any sort of direct coordination. Meanwhile Iran continues to support embattled Syrian autocrat Bashar al-Assad, who Washington opposes.
Rouhani, in his Tuesday comments, said greater regional cooperation among affected countries was the only solution to confronting the Islamic State group.
"We have no doubt that boosting friendly relations between Iran and Iraq will secure the interests of both countries and will serve the interests of the region," he said. "Regional countries should confront terrorism in a united and coordinated way in order to uproot this phenomenon."
Inside Iraq, insurgents continued their recent wave of attacks on Tuesday as a string of bombings in and near Baghdad killed 30 people. Police officials said the deadliest attack took place Tuesday afternoon when a double car bomb attack hit Habaybina restaurant in the Shiite-majority district of Talibiya in eastern Baghdad, killing 19 people and wounding 32 others.
Earlier, a bomb struck at an outdoor market in the southern district of Abu Dashir, a mostly Shiite neighborhood, killing four people and wounding nine, police officials said.
A little bit later, a bomb that went off near a small restaurant in central Baghdad killed five people and wounded 12, the officials said. Another bomb exploded at a commercial street in the town of Madian, just south of Baghdad, killing two people and wounding four.
Medical officials confirmed the casualty figures. All officials spoke on condition of anonymity because they were not authorized to talk to the media.
No one immediately claimed responsibility for the latest attacks but they bore the hallmarks of the al-Qaida-breakaway Islamic State group, which has captured large chunks of territory in western and northern Iraq, plunging the country into its worst crisis since U.S. troops left at the end of 2011.
On Monday, militants unleashed a wave of deadly attacks on Iraq's majority Shiite community, killing at least 43 people. In the Shiite holy city of Karbala — home to the tombs of two revered Shiite imams and the site of year-round pilgrimages — four separate car bombs went off simultaneously, killing at least 26 people.
The attacks on the Shiites are likely calculated by the Sunni extremists to sow fear among Iraqis on both sides of the sectarian divide.
Yacoub reported from Baghdad. Associated Press writer Murtada Faraj in Baghdad contributed to this report.