Iraqi security forces said Sunday they defused nine bombs as millions completed the annual Ashura rituals in Shiite shrine cities, free of the massive attacks that have marred recent years.

But violence again hit the ceremonies elsewhere in Iraq, with five dead in the bombing of a procession near the northern oil city of Kirkuk among a total of 32 faithful killed since Tuesday.

The chief of military operations in Karbala, which is the focal point of the rituals, said two Al-Qaeda cells were arrested north of the central shrine city.

"They had a plan to target visitors and even put several IEDs (improvised explosive devices) on the main road," General Usman al-Ghanemi told a news conference as the 10 days of ceremonies concluded.

Around three million people thronged the streets of Karbala for the main rituals commemorating the slaying of the revered Imam Hussein by the armies of the Sunni caliph Yazid in 680.

"Over the past 10 days, we have received around six million visitors who have come from all over Iraq, some coming by foot," Karbala provincial deputy governor Nasaeef Jassim said, adding that at least half had stayed for Sunday's climax.

He said that among the pilgrims were some 105,000 worshippers from abroad, mostly from the Gulf but also from other countries with significant Shiite communities including Pakistan.

Sunday's bomb in northern Iraq ripped through an Ashura procession in the town of Tuz Khurmatu, killing five people and wounding 27, including five women and a policeman, police said.

The Tuz attack came a day after three Shiites were killed when bombs struck separate Ashura processions in Baghdad.

Since Tuesday, 33 people have been killed and more than 160 wounded in violence targeting Ashura, including attacks on worshippers in Karbala and Baghdad earlier in the week.

A peaceful Ashura was seen as crucial for the electoral prospects of Prime Minister Nuri al-Maliki, who has built his reputation on bringing security to Iraq and is contesting March 7 elections on a new multi-confessional ticket.

In a statement released by his office Sunday evening, Maliki praised the "exceptional efforts" of Iraq's security forces, which he credited with having "averted several terrorist attacks" during the day's rituals.

Previous years' ceremonies were marred by attacks by Sunni Arab insurgents and disrupted by intra-Shiite fighting.

In March 2004, near-simultaneous bombings in Karbala and at a Shiite mosque in Baghdad killed more than 170 people.

This year's ceremonies began with thousands of devotees drenched in blood after ritually slicing their scalps and ended with a re-enactment of the battle for Karbala in which Imam Hussein was killed.

Tradition holds that the revered imam was decapitated and his body mutilated.

To show their guilt and remorse for not defending Hussein, Shiites cut their scalps and flay themselves with chains attached to sticks during processions.

Sad songs were played on loudspeakers throughout the city and mostly black flags were on display, along with pictures of Imam Hussein and Imam Abbas, both of whom are buried in the city.

Masses of black-clad pilgrims took part in a ritual five-kilometre (three-mile) run, known as the "Twairij", around midday (0900 GMT) to Imam Hussein's shrine while hitting their heads with their hands and screaming "Labeikeh Hussein" (We are your followers, Hussein).

They then set fire to tents set up in the city to re-enact the scene of the final battle between Hussein and Yazid's armies.

Shiites make up around 15 percent of Muslims worldwide. They represent the majority populations in Iraq, Iran and Bahrain and form significant communities in Afghanistan, Lebanon, Pakistan and Saudi Arabia.