The bomber struck in the Khales area, killing five people and wounding 10, a police colonel and a doctor said.
The colonel said one of the dead was a policeman tasked with guarding the pilgrims, who embraced the bomber just before the attack in an effort to shield others from the blast.
It was the latest in a series of attacks on Shiite pilgrims in recent days, including two in Baghdad province that killed at least eight pilgrims yesterday, and two car bombs targeting pilgrims that left at least 24 dead the day before.
The 40th day, known as Arbaeen, falls on December 23 this year.
More From This Section
Sunni militants, including those linked to Al-Qaeda, frequently target members of Iraq's Shiite majority, whom they consider to be apostates.
Also today, a roadside bomb in the northern city of Mosul killed two people and wounded two others, while gunmen killed two soldiers and wounded two more in an attack on a checkpoint, police and a morgue official said.
More people died in violence in the first eight days of this month than in the whole of last December, and over 6,550 people have been killed since the beginning of 2013, according to AFP figures based on security and medical sources.