ERBIL, Iraq — At least 80 people, many of them Shiite pilgrims on their way home to Iran, were killed on Thursday when an Islamic State suicide bomber detonated a truck filled with explosives at a roadside service station in southern Iraq, local officials said.

The devastating attack came two days after Prime Minister Haider al-Abadi applauded the security forces for protecting the millions of Shiites who have flowed through southern Iraq in recent days for what many consider the world’s largest religious pilgrimage, larger even than the hajj in Saudi Arabia.

In years past, the annual rite known as Arbaeen, a commemoration of the martyrdom of Imam Hussein, a revered seventh-century Shiite figure, was a frequent target of Sunni extremist groups like the Islamic State and its predecessor, Al Qaeda in Iraq.

Until the bombing on Thursday, for which the Islamic State claimed responsibility in a statement, the event had been carried out safely. That was seen as a success for Mr. Abadi and the military, and was hailed as a sign that the government could keep pushing a major offensive against the Islamic State in Mosul, while protecting pilgrims in the south.