The rifle-carrying attackers entered the Khawaja Hassan mosque in Gardez city, Paktia province, during Friday prayers and started shooting at worshippers before detonating their explosives, said Sardar Wali Tabasum, provincial police chief spokesman.
“Emergency teams have collected 25 bodies from the mosque premises,” said Abdullah Hazrat, spokesman for the provincial governor. At least 81 others were also wounded in the attack, he added.
Al Jazeera’s Charlotte Bellis, reporting from the capital, Kabul, said, “We understand that there were more than 100 people inside the mosque at the time of the attack.”
There was no immediate claim of responsibility, but the Taliban armed group denied any involvement.
Afghan President Ashraf Ghani condemned the attack, calling it “inhumane”. He said Afghans will not be divided by sectarian violence.
The attack was the latest to hit urban areas across Afghanistan in recent months.
At least 15 people were killed and 15 wounded after two gunmen stormed a government building in the eastern city of Jalalabad earlier this week.
Shia Muslims have been targeted by groups affiliated to the Islamic State of Iraq and the Levant (ISIL, also known as ISIS) that has emerged as a force in recent years.
According to the United Nations, a total of 1,692 people have been killed in the first half of 2018, with another 3,430 people wounded – the highest figure since it began keeping records in 2009.