A suicide bomber killed at least 40 people and wounded dozens of others as they gathered for morning prayers in northern Afghanistan.
Bodies seen were lying on the ground after a suicide bomber blew himself up outside a mosque in Maymana, the capital of Faryab province.
The mosque was particularly crowded as worshippers had gathered to pray at the start of the annual Muslim Eid al-Adha holiday, a three-day celebration when families typically gather together.
Afghan President Hamid Karzai strongly condemned the attack, saying those behind the bombing were "enemies of Islam and humanity". In an earlier statement marking the Eid holiday, Karzai had urged the Taliban to lay down their arms.
"I am calling on Taliban and other opponents to stop destruction of their homeland, stop the killing of their own people, the destruction of their mosques, hospitals and schools, and to stop working for the aims of foreigners, return to their homeland and start living with dignity and according to constitution of the country," said Karzai.
The northern province of Faryab is relatively peaceful. Officials say the target of the suicide attack was a provincial police officer, who survived the bombing.
According to the International Security Assistance Force (ISAF), an average of 243 Afghan soldiers and almost 292 Afghan police have been killed and wounded every month this year.
Police spokesman Lalal Mohammad Ahmadzai said that Afghan security personnel were among those killed in the attack as they left the mosque after the Eid prayer.
The U.S. Embassy in Kabul and the head of U.S. and NATO forces in Afghanistan, General John Allen, swiftly condemned the bombing. Allen said the attack was an "affront to human life".
According to a United Nations report released this summer, more than 3,000 civilians have been killed and wounded in the Afghan conflict in the first six months of this year alone. A third of the victims were women and children.
The Taliban has increased its attacks on Afghan security. Friday's violence underscores the challenges Afghanistan's security forces will face as the last of international combat troops leave the country by the end of 2014.