Hundreds of supporters of powerful Iraqi cleric Moqtada Sadr danced and sang in parliament Wednesday after storming Baghdad's high-security Green Zone in protest at a rival bloc's nomination for prime minister.

Police fired barrages of tear gas in a bid to stop the protesters from breaching the gates of the heavily fortified Green Zone, but the crowds surged forward and entered parliament.

"I am against the corrupt officials who are in power," said protester Mohamed Ali, a 41-year-old day labourer, one of the hundreds who entered the zone that is home to both government buildings and diplomatic missions, before later leaving peacefully.

The protests are the latest challenge for oil-rich Iraq, which remains mired in a political and a socioeconomic crisis despite soaring global energy prices.

Sadr's bloc emerged from elections in October as the biggest parliamentary faction, but was still far short of a majority and, nine months on, deadlock persists over the establishment of a new government.

Crowds wandered around the parliament building waving national flags, taking photographs, chanting and cheering.

Prime Minister Mustafa al-Kadhemi called on the protesters to "immediately withdraw", warning that the security forces would ensure "the protection of state institutions and foreign missions, and prevent any harm to security and order".

But it took orders issued by the Shiite leader Sadr before the crowds of protesters started to leave nearly two hours later.

"Revolution of reform, and rejection of injustice and corruption," Sadr wrote on Twitter, in support of the protesters.

"Your message has been heard... you have terrorised the corrupt", he added, calling on the demonstrators to say a prayer "before returning home safe and sound".

"We obey the Sayyed," the crowds chanted as they calmly left parliament, a term honouring Sadr by acknowledging him as a descendant of the Prophet Mohammed.

Sadr's bloc won 73 seats in last year's election, making it the largest faction in the 329-seat parliament. But since the vote, talks to form a new government have stalled.

The protesters oppose the candidacy of Mohammed al-Sudani, a former minister and ex-provincial governor, who is the pro-Iran Coordination Framework's pick for premier.

The Coordination Framework draws lawmakers from former premier Nuri al-Maliki's party and the pro-Iran Fatah Alliance, the political arm of the Shiite-led former paramilitary group Hashed al-Shaabi.

"I am against Sudani's candidacy, because he is corrupt," added protester Mohamed Ali.

"We reject the whole political process", said Bashar, a protester in parliament, giving only his first name. "We want an independent person who serves the people".

Iraq was plunged deeper into political crisis last month when Sadr's 73 lawmakers quit en masse.

Sadr had initially supported the idea of a "majority government" which would have sent his Shiite adversaries from the Coordination Framework into opposition.

The former militia leader then surprised many by compelling his lawmakers to resign, a move seen as seeking to pressure his rivals to fast-track the establishment of a government.

Sixty-four new lawmakers were sworn in later in June, making the pro-Iran bloc the largest in parliament.

Earlier this month, hundreds of thousands of Muslim worshippers loyal to Sadr attended a Friday prayer service in Baghdad, in a display of political might.

The huge turnout came despite scorching heat and the Shiite cleric not being there in person -- an indication of his status as a political heavyweight, as well as a key religious authority.

The mercurial cleric's sermon took aim at rivals from other Shiite factions.

"We are at a difficult... crossroads in the formation of the government, entrusted to some we do not trust," Sadr said in the speech on July 15, read out by Sheikh Mahmud al-Jayashi.

Sadr's sermon took particular aim at the Hashed al-Shaabi, which has been integrated into the army, but is seen by many Iraqis as an Iranian proxy.

Hashed supporters last year protested near the Green Zone, demonstrating against what they said was vote "fraud".