Two rocket attacks targeted American diplomatic and military installations overnight, Iraq's security forces said Sunday, a little over a week since unprecedented arrests prevented a similar incident.

Since October, US diplomats and troops across Iraq have been targeted by around three dozen missile attacks which Washington has blamed on pro-Iranian armed factions.

In the first move of its kind, elite Iraqi troops in late June arrested more than a dozen Tehran-backed fighters who were allegedly planning a new attack on Baghdad's Green Zone, home to the US and other foreign embassies.

Iraqi government officials said the raid would serve as a "message" to deter future attacks, but early on Sunday, militants made another attempt.

One rocket fired at the Green Zone landed near a home, wounding a child, according to the Iraqi military.

"At the same time, our forces were able to thwart another attack and seize a Katyusha rocket and launcher that were targeting the Taji base north of Baghdad," where US-led coalition troops are based, it added.

The attempts came just hours after the US embassy tested a new rocket defence system known as a C-RAM, according to a senior Iraqi security source.

The C-RAM, set up earlier this year at the embassy, scans for incoming projectiles and explodes them in the air by targeting them with several thousand bullets per minute.

A series of muted blasts could be heard across Baghdad on Saturday as the system was apparently tested, leaving passersby confused and Iraq's parliament outraged.

Deputy speaker Hassan al-Kaabi slammed the trial as "provocative" and "unacceptable" as it could put residential areas in danger.

There was no immediate comment from the embassy on whether the system was used against the rocket overnight.

The US embassy compound in Baghdad, seen here in January, has been repeatedly targeted by militants The US embassy compound in Baghdad, seen here in January, has been repeatedly targeted by militants Photo: DoD / Sgt. Kyle Tabot

Iraq has long been caught in a tug-of-war between its two main allies Iran and the US -- arch-enemies whose relations have further crumbled since Washington pulled out of a landmark nuclear deal with Tehran in 2018.

Baghdad carefully balances its ties to the two countries, but the repeated rocket fire risks rocking its tightrope.

The US blames the attacks on Kataeb Hezbollah, a Tehran-backed faction within Iraq's state-sponsored network of armed units known as the Hashed al-Shaabi.

Washington has demanded Iraqi authorities be tougher on the group. Local forces had long hesitated, fearing that direct action against such a powerful actor would risk broader confrontations.

But last month, state security forces carried out the first raid of its kind against a Kataeb Hezbollah base on the edges of Baghdad, seizing rockets and arresting 14 fighters allegedly planning an attack on the Green Zone.

The move was hailed by US Secretary of State Mike Pompeo, who said rogue groups are "the single biggest obstacle to additional assistance or economic investment" for Iraq.

"Baghdad's actions are a step in the right direction and we applaud them," he said last week.

But within days, all but one of the fighters were released and some were seen burning US and Israeli flags and stepping on pictures of Iraqi Prime Minister Mustafa al-Kadhemi.

Kadhemi has repeatedly vowed to put an end to the missile fire, and the continued attacks are seen as a challenge to his authority.

Kataeb Hezbollah in particular is deeply suspicious of Kadhemi, accusing him of complicity in the US killing of Iranian General Qasem Soleimani and the Hashed's deputy chief in a January drone strike in Baghdad.

The group first began fighting US troops in 2003, following the American-led invasion to topple Saddam Hussein.

According to paramilitary expert Michael Knights, it is the top armed Iraqi ally of Iran's Revolutionary Guard Corps, which Washington has designated a "terrorist" group.