Two burka-clad militants attacked the mosque in the city of Gardez in the province of Paktia where more than 100 people had gathered to offer prayers, said Raz Mohammad Mandozai, the police chief of Paktia.
The attackers then opened fire on security guards of the mosque. No group has yet claimed responsibility for the attack. The blood of the worshippers had painted the walls of the mosque.More news: 5 discussion points: England beat India in first Test
It comes as urban areas across Afghanistan have been rocked by an increasing number of attacks in recent months, with both Islamic State (IS) and Taliban insurgents targeting security forces and government installations.
The UN Assistance Mission in Afghanistan (UNAMA) said in a report last month that the number of civilians killed in Afghanistan reached a record high in the first half of the year, despite last month's ceasefire, with a surge in suicide attacks claimed by Daesh.
A Shiite mosque in the eastern Afghan city of Gardiz was the target of a suicide attack on Friday, local health officials told media.
The attack in Gardez comes as USA and Afghan forces are intensifying ground and air offensives against IS, and the Taliban is stepping up its war with the group.More news: NAB summons Imran Khan on August 7 in helicopter misuse case
Afghan civilians have borne the brunt of the war that began after the 2001 US-led invasion uprooted the Taliban regime.
"Several wounded people were shifted to a military hospital in Afghan Army's Corps 203 Thander for intensive treatment as the government-run hospitals were not able to provide treatment for all the victims", Ahmadzai said.
Almost 1,700 civilians were killed in the first half of this year, the United Nations says, the highest total recorded for the period since counting began in 2009.More news: Newcastle sign Japan's Yoshinori Muto, as Rafa Benitez expresses concerns