A suicide bomber killed at least 40 people in a mosque in Afghanistan's relatively peaceful north as worshippers gathered for prayers marking the Muslim Eid al-Adha holiday.
Another 40 people were wounded in the attack in Maimana, capital of Faryab province.
Regional police chief General Abdul Khaliq Aqsai blamed the Taliban, but a Taliban spokesman said they were investigating to find out who was responsible.
A police spokesman said that almost half of the dead were police and that Mr Aqsai appeared to be the target.
"As soon as the police chief got in his vehicle, the bomber detonated his explosives," the spokesman added.
About 20 bodies, some in police uniform, lay in front of the mosque's gates as smoke billowed above.
The attack, at around 9am local time, came just before President Hamid Karzai repeated his call for the Taliban to join the government.
"If you [Taliban] want to come to the government, you are welcome. You have rights as an Afghan and as a Muslim," he said in a speech in Kabul.
Afghanistan and the US have been seeking separate peace negotiations with the Taliban as the 2014 deadline looms for most foreign troops to leave.
Mr Karzai condemned the mosque attack in a statement.
Violence is intensifying across the country 11 years into the NATO-led war, sparking concerns over how the 350,000-strong Afghan security forces will manage once most foreign troops leave.
The Taliban, in a statement released to media, said two Afghan soldiers were behind the attack in western Farah province yesterday that killed one Italian soldier.
One of them later joined the Taliban, the statement said, along with the policeman who killed two US soldiers in southern Uruzgan province yesterday.
That attack was the latest insider attack, when Afghan security forces turn their weapons on their foreign mentors and partners.
At least 54 members of the NATO-led force have been killed so far this year in insider attacks, which have been eroding trust between Afghanistan and its western backers.