Nearly 40 people have been killed and dozens more injured in a bombing and shooting attack at a Shia mosque in eastern Afghanistan near Pakistan's border.

The police on Friday confirmed the attack in the city of Gardez, the center of Paktia province.

Two burka-clad militants attacked the mosque, where more than 100 people had gathered to offer prayers, said Raz Mohammad Mandozai, the police chief of Paktia.

At least 80 people were injured when the men struck with guns and explosives at the Khawaja Hassan mosque.

Gardez city hospital reported receiving at least 50 adults and 20 children wounded in the attack. Abdullah Hazrat, a senior government official, said the militants opened fire on the worshippers and one blew himself up, while the other assailant was gunned down by the mosque's security forces.

Casualty numbers are sketchy. A police official said 70 people had lost their lives in the attack, for which no group or individual has claimed responsibility.

Militants of Taliban and the Daesh Takfiri terrorists in Afghanistan frequently attack civilian and government targets.

Despite the US-led invasion of Afghanistan in 2001, which was conducted as part of Washington’s so-called war on terror, acts of terror remain across the country.

In July, the United States said it was ready to initiate direct talks with Taliban in an attempt to end a 17-year-old war in Afghanistan, a significant shift in American policy in the conflict-ridden country. Taliban have repeatedly declared that they would not enter into talks unless the foreign forces leave the country.