The US Embassy in Baghdad said that all public consular operations were suspended, a day after supporters of Iraq's pro-Iranian force Hashed al-Shaabi stormed its outer perimeter, setting fires, throwing rocks and smashing surveillance cameras.

"Due to militia attacks at the US Embassy compound, all public consular operations are suspended until further notice. All future appointments are cancelled. US citizens are advised to not approach the embassy," it said in a statement.

The protesters have fully withdrawn from the embassy after thousands of Iraqi supporters of the largely Iranian-trained Hashed force had gathered there yesterday, outraged by US strikes that killed 25 Hashed fighters over the weekend

They marched unimpeded through the checkpoints of the usually high-security Green Zone to the embassy gates, where they broke through a reception area, chanting "Death to America" and scribbling pro-Iran graffiti on the walls.

Iraq's caretaker premier Adel Abdel Mahdi called on the angry crowd to leave the embassy but most spent the night in dozens of tents set up outside the perimeter wall.

This morning, crowds of men brandished the Hashed's colours, set US flags on fire and hurled rocks towards the compound. 

Security personnel inside responded with tear gas, wounding at least 20 people, the Hashed said. 

By the afternoon, the Hashed called on its supporters to leave the embassy and regroup outside the Green Zone "out of respect for the state." 

"You delivered your message," it said in a statement. 

Yesterday's embassy attack was the latest episode in spiralling tensions between the United States and Iran since Washington abandoned a landmark nuclear deal with Tehran in 2018.

Many of those tensions have played out in Iraq, which has close ties with both governments.

US forces, who number some 5,200 across Iraq, have faced a spate of rocket attacks in recent months that US officials have blamed on pro-Iran factions within the Hashed. 

Last week, one of those attacks killed a US contractor, prompting retaliatory US air strikes that killed 25 fighters from Kataeb Hezbollah (Hezbollah Brigades).

President Donald Trump and other top US officials have blamed Iran for attacks on US forces and for storming the embassy compound. 

"They will pay a very BIG PRICE! This is not a Warning, it is a Threat," Mr Trump wrote on Twitter, adding "Happy New Year!"

Iran's supreme leader today condemned US strikes on Iraq and warned that his country was ready to hit back.

"I and the government and the nation of Iran strongly condemn this American crime," Ayatollah Ali Khamenei said in a speech broadcast on state television.

"If the Islamic republic decides to oppose or fight against a country, it will do this explicitly," he said.

Tehran's foreign ministry said it had summoned an official from the Swiss embassy, which represents US interests in Iran, to complain about American "warmongering" in Iraq.

Today Iraqi forces had reimposed normal security measures around the perimeter of the Green Zone, usually inaccessible without a badge.

US officials were alarmed that protesters yesterday were able to stream through checkpoints so easily.

An Iraqi special forces fighter assigned to guard the Green Zone told AFP that units had no orders to intervene as the pro-Iran protesters marched past them.

"If I had had orders to act, I could have fired and stopped the storming of the embassy," he said.

"But after what happened, our hands are tied. We can't prevent the situation from deteriorating," he added.

US officials have pressured Iraqi forces to step up security and sent a rapid response team of marines to help guard the compound overnight.

US Defense Secretary Mark Esper said around 750 troops from the 82nd Airborne Division were prepared to deploy to the region in the coming days.

No US personnel were injured and US officials said there were no plans to evacuate the mission.

Ambassador Matthew Tueller, who had been on holiday, was said to be on his way back to Baghdad.

The attack highlighted the strains in the US-Iraqi relationship, which officials from both countries have described to AFP as the "coldest" in years.

The US led the 2003 invasion against then-dictator Saddam Hussein and has worked closely with Iraqi officials since then, but its influence has waned in the face of Tehran's growing clout in Baghdad.