Protests against the US presence in Iraq have been staged by Shias in the central city of Karbala at the climax of a pilgrimage that has attracted up to one million people.
The self-flagellation honours the suffering of Imam Hussein
Groups of marchers chanted slogans against a US-imposed government and called for unity among Shias.
Many others hit their backs with flails or cut their heads with swords in ritual self-flagellation.
The Shias have gathered in the holy city to commemorate the death in the 7th century of Imam Hussein, grandson of the Prophet Mohammed.
Saddam Hussein was evil. And so is America
Khudayer Abbas Musawi
As the ritual banned under ousted Iraqi President Saddam Hussein continued, a prominent Shia cleric said he had been beaten by US soldiers after being detained near Baghdad on Sunday.
Sheikh Mohammed al-Fartusi condemned US methods as worse than those employed by Saddam Hussein.
Meanwhile US officials, speaking to the Washington Post, said they had underestimated the strength and organisation of the Iraqi Shia and now feared the rise of anti-American Islamic militancy.
In Karbala, the pilgrims marched to the beat of drums as they converged on Imam Hussein's shrine for Wednesday's noon prayers.
Amid the throngs, groups of marchers held anti-US protests carrying banners with slogans such as "No to
America, no to Israel, yes to Islam."
Pilgrims are expected to leave Karbala after Wednesday's prayers
Others chanted "no to Chalabi", referring to Ahmad Chalabi, the US-favoured leader of the Iraqi National Congress (INC), who has returned after decades of exile.
However the BBC's Damien Grammaticas in Karbala says the anti-US demonstrations were small-scale, involving only a few hundred people.
US troops again remained largely out of sight, while a few members of the INC manned checkpoints.
The pilgrims, who went to Karbala from various towns in Iraq, are expressing a religious fervour that was banned for a quarter of a century under Saddam Hussein.
As the men march, a wave of arms is thrust into the air, then whips back with an echoing thud as the pilgrims slap themselves across their chests.
They furiously strike their heads as the pace and singing reach a crescendo.
A quiet tap, tap, tap accompanies the rhythm from women
who watch, patting their foreheads and cheeks.
One man with no hands beat himself with his arm stumps.
With the ritual self-flagellation, the Shia signal their willingness to suffer in honour of Imam Hussein, who died because the people failed to rise up and support him in the face of a vast army.
In Baghdad, Sheikh Fartusi's release from detention along with five other Shias drew cheers from hundreds of supporters.
He told Abu Dhabi television: "Our arrest by the Americans was worse than the arrests that Saddam ordered against our students."
He said he and his fellow detainees "were beaten... and spent a night with our hands tied behind our backs".
US officials have said they cannot confirm Sheikh Fartusi's arrest.