The building of US embassy compund are seen in the heavily fortified Green Zone in central Baghdad - REX

Three rockets slammed into the US embassy in Iraq's capital on Sunday in the first direct hit reported after months of close calls, as thousands kept up anti-government sit-ins across the country.

The attack marked a dangerous escalation in the spree of rocket attacks in recent months that have targeted the embassy or Iraqi military bases where American troops are deployed.

None of the attacks has been claimed but Washington has repeatedly blamed Iran-backed military factions in Iraq.

On Sunday, one rocket hit an embassy cafeteria at dinner time while two others landed nearby, a security source told AFP.

A senior Iraqi official told AFP at least one person was wounded, but it was not immediately clear how serious the injuries were and whether the person was an American national or an Iraqi staff member working at the mission.

The US embassy did not immediately respond to requests for comment.

The attack took place earlier in the day than usual, with AFP reporters hearing the booms on the western bank of the river Tigris at precisely 7:30 pm (1630 GMT).

Iraqi Prime Minister Adel Abdel Mahdi and Speaker of Parliament Mohammed Halbusi both condemned the incident, saying it risked dragging their homeland into war.

Iraq has already been dragged into a worrying tit-for-tat between the United States and Iran over the last month.

A similar attack on a northern Iraqi base killed an American contractor, and the US retaliated with a strike on an Iran-backed faction known as Kataeb Hezbollah.

Less than a week later, a US drone strike killed Iranian general Qassim Soleimani and Iraqi military figure Abu Mahdi al-Muhandis outside the Baghdad airport - prompting Iran to fire ballistic missiles at an Iraqi base where US troops are stationed.

Some 5,200 Americans are stationed in Iraq to lead the global coalition fighting the Islamic State group, but the US strike on Baghdad has rallied top Iraqi figures around a joint call to order them out.

Story continues

Vehemently anti-American cleric Moqtada Sadr organised a mass rally in Baghdad on Friday, where thousands of his supporters called for American troops to leave.

Protesters set fire to close a street during clashes between security forces and anti-government protesters near Baghdad's Khilani square Credit: AP

Sadr had previously backed separate anti-regime protests sweeping Iraq's capital and south, even though he controls the largest bloc in parliament and top ministerial posts.

Bolstered by his own protest on Friday, Sadr announced he was dropping support for the youth-dominated reform campaign rocking the country since October.

His followers, widely regarded as the best-organised and well-stocked of the anti-government demonstrators, immediately began dismantling their tents and heading home.

Activists feared that without his political cover, authorities would move to crush their movement - and indeed, within hours, riot police tried to storm protest camps across the capital and south.

Those efforts continued into Sunday, with security forces using live rounds and tear gas to try to flush protesters out of squares and streets they had occupied for months.

One protester was shot dead in Baghdad and another in the flashpoint southern city of Nasiriyah, medical sources said, and dozens more were wounded across the country.

Despite the renewed violence, thousands of students flooded the streets in the capital and across the south in a bid to keep national attention focused on their demands.

"Only for you, Iraq!" read a sign held by a young protester in the shrine city of Karbala, hinting at the movement's insistence on not being affiliated with any political party or outside backer.

In Basra, hundreds of students gathered to condemn the riot police's dismantling of their main protest camp the previous day, according to an AFP correspondent.

In Baghdad, university students marched from a campus in the city centre to the main rally area of Tahrir Square.

Riot police fired live rounds and tear gas at clusters of young protesters in the nearby Khallani and Wathba squares, but protesters threw rocks and Molotov cocktails to keep them back.

Security forces have stopped short of entering Tahrir Square, where some protesters stood their ground even after many tents were dismantled.

In Nasiriyah, security forces fired live rounds to disperse demonstrators angered by authorities pushing them out of roads around their main protest camp in Habbubi Square.

The youth-led protests erupted on October 1 in outrage over lack of jobs, poor services and rampant corruption before spiralling into calls for a government overhaul after they were met with violence.

More than 470 people have died, a vast majority of them demonstrators, since the rallies erupted.

Protesters are now demanding snap elections, the appointment of an independent premier and the prosecution of anyone implicated in corruption or recent bloodshed.

Their voices have been heard by top UN envoy in Iraq Jeanine Hennis-Plasschaert who has said: "Unaccountability and indecisiveness are unworthy of Iraqi hopes, courageously expressed for four months now."

"While death and injury tolls continue to rise, steps taken so far will remain hollow if not completed," she said Saturday.