Men cover the graves of victims with soil after their burial at a graveyard in Kandahar on October 16, 2021. AFP
Religious authorities in the southern city of Kandahar told AFP the toll from Friday's assault had reached 60, as hundreds of diggers opened row after row of graves in the dusty soil.
The latest massacre came just a week after another IS-claimed attack on Shia worshippers at a mosque in the northern city of Kunduz that killed more than 60 people.
In a statement released on its Telegram channels, the jihadist group said two Islamic State-Khorasan (IS-K) suicide bombers carried out separate attacks on different parts of the mosque in Kandahar -- the spiritual heartland of the Taliban -- while worshippers prayed inside.
The group, bitter rivals of fellow Sunni Islamist movement the Taliban, who swept back to power in Afghanistan in August as the United States and its allies withdrew, regards Shia Muslims as heretics.
UK-based conflict analysis firm ExTrac said Friday's assault was the first by IS-K in Kandahar, and the fourth mass casualty massacre since the Taliban took Kabul.
Researcher Abdul Sayed told AFP the attack "challenged the Taliban claims of holding control on the country. If the Taliban can't protect Kandahar from an IS-K attack, how could it protect the rest of the country?"
The killings triggered international condemnation. UN Secretary General Antonio Guterres condemned the "despicable attack" and demanded those using violence to restrict Afghans' religious freedom be brought to justice.
At the gravesides, mourner Gul Ahmad told AFP of his grief over his brother's slaying: "He had two little children. He had a home to live in. He had everything. The pain of the loss cannot be described with words."
The all-male crowd brought body after body, shrouded in white sheets, as a dust storm was whipped up by the constant digging.
"The world will remember this. The Islamic world will remember this barbarism, specifically the dignified people of Afghanistan," warned another mourner, Muhammad Agha.
Inside the mosque, after the blast, the walls were pockmarked by shrapnel and volunteers swept up debris in the ornately painted prayer hall. Rubble lay in an entrance corridor.
In the wake of the explosions, Kandahar police chief Maulvi Mehmood said security for the mosque had been provided by guards from the Shia community but that following the "brutal attack" the Taliban would take charge of its protection.
Witnesses spoke of gunfire alongside the explosions, and a security guard assigned to protect the mosque said three of his comrades had been shot as the bombers fought their way in.
Sayed Rohullah told AFP: "It was the Friday prayer time, and when we were preparing I heard shots. Two people had entered the mosque.
"They had opened fire on the guards and in response the guards had also opened fire on them. One of them committed a suicide blast inside the mosque."
Other bombs were detonated in crowded areas outside the main building, he and other witnesses said.
US State Department spokesman Ned Price said Washington condemned the attack and reiterated a call for the "Taliban to live up to the commitment it has made to counterterrorism, and specifically to taking on the shared threat we face from ISIS-K".
"We are determined to see to it that no group... can ever again use Afghan soil as a launching pad for attacks on the United States or other countries."
The Taliban, who seized control of Afghanistan after overthrowing the US-backed government, have their own history of persecuting Shiites.
But the new Taliban-led administration has vowed to stabilise the country, and in the wake of the Kunduz attack promised to protect the Shia minority now living under its rule.
Shiites are estimated to make up roughly 10 percent of the Afghan population. Many of them are Hazara, an ethnic group that has been persecuted in Afghanistan for decades.
In October 2017, an IS suicide attacker struck a Shia mosque in the west of Kabul, killing 56 people and wounding 55.