No violence was reported during the rally in Sadr City. But dozens of people were killed elsewhere in the country, most of them in a car bombing and gun battle in Mosul in the north.
The demonstration was the biggest in the Middle East in support of Hezbollah since Israel launched its attacks against the Shia guerrillas in Lebanon on July 12.
The protest was organised by Muqtada al-Sadr, an Iraqi Shia leader critical of the US occupation of Iraq.
Al-Sadr summoned followers from throughout the Shia heartland of southern Iraq, including members of his al-Mahdi Army group, to converge on Baghdad for the rally; but he himself did not attend.
Tensions were raised before the rally by claims from al-Sadr's movement that US soldiers had fired on a convoy of protesters as it travelled north to Baghdad through the town of Mahmudiyah on Thursday, wounding 16 of them.
But the US military said the soldiers had only responded after one of their watchtowers had come under fire from a passing van and that they had killed "two terrorists" in the subsequent exchange.
Demonstrators, wearing white shrouds symbolising willingness to die for Hezbollah, waved the Lebanese guerrillas' yellow banner and chanted slogans in support of their leader, Sheik Hassan Nasrallah.
"Allah, Allah, give victory to Hassan Nasrallah," the crowd chanted.
"Mahdi Army and Hezbollah are one, let them confront us if they dare," the predominantly male crowd shouted, waving the flags of Hezbollah, Lebanon and Iraq.
"I consider my participation in this rally a religious duty. I am proud to join this crowd and I am ready to die for the sake of Lebanon"
a Shia protester
Many walked with umbrellas in the searing afternoon sun. Volunteers sprayed them with water.
"I am wearing the shroud and I am ready to meet martyrdom," said Mohammed Khalaf, 35, owner of a clothes shop in the southern city of Amarah.
Al-Sadr followers painted US and Israeli flags on the main road leading to the rally site, and demonstrators stepped on them
Alongside the painted flags was written: "These are the terrorists."
Protesters set fire to American and Israeli flags, as well as to effigies of George Bush, the US president, and Ehud Olmert, the Israeli premier, showing the pair with Dracula teeth.
"Saddam and Bush, Two Faces of One Coin" was scrawled on Bush's effigy.
Protesters walk over an
Iraq's state television said the defence ministry had approved the demonstration, a sign of the public anger over Israel's offensive in Lebanon and of al-Sadr's stature as a major player in Iraqi politics.
"I consider my participation in this rally a religious duty. I am proud to join this crowd and I am ready to die for the sake of Lebanon," said Khazim al-Ibadi, 40, a government employee from Hillah.
Although the rally was about Hezbollah, it was also a show of strength by al-Sadr, and many worried that the presence of so many Shia demonstrators - most of them al-Mahdi Army members - would add to tensions in the city that has seen almost daily clashes between Shia and Sunni fighters.
The sectarian violence escalated after the February 22 bombing of a Shia shrine in Samarra and unleashed a wave of reprisal attacks on Sunnis nationwide.
Killings in northern Iraq
In the latest violence on Friday, nine police, including a battalion commander were killed in a car bomb in Mosul, followed by attacks from insurgents.
"I am wearing the shroud and I am ready to meet martyrdom"
The police commander for the province said the situation was under control and numerous "Al-Qaeda" insurgents had been killed.
South of Mosul, a suicide car bomber drove his vehicle into a soccer match, killing three policemen and seven civilians.
A member of one of the former regime's security services was shot dead on Friday morning in the southern city of Amara and a bystander was killed just south of the capital in a roadside bomb targeting a police patrol.