A suicide attacker has killed at least 41 people and injured 51 in northern Afghanistan, local officials have said.
The attack on Friday occurred when a man detonated explosives that he was carrying outside a mosque in Maymana, the capital of Faryab province.
Witnesses say the attacker was wearing a police uniform as he passed through four security checkpoints. He blew himself up at the entrance to the city's packed Eid Gah mosque, deputy provincial governor Abdul Satar Barez told the AFP news agency.
"Our latest death toll shows 41 deaths, and that might rise," he said. "Nineteen were members of the security forces, including police, army and intelligence agents. Seventeen were civilians and five children are also among the dead."
Al Jazeera's Bernard Smith, reporting from Kabul, said the 41 victims were a mixture of civilians and members of the Afghan National Security Forces. The bulk of those killed were outside the mosque at the time of the attack. "It appears the target was military and security force members", said our correspondent.
The provincial police chief sustained some injury. Barez, like many other provincial officials, was at the scene at the time of the bombing and described the horror of the blast in the midst of a religious celebration. "We had just finished Eid al-Adha prayers and we were congratulating and hugging each other," Barez said.
"Suddenly a big explosion took place and the area was full of dust and smoke and body parts of police and civilians were all over the place. It was a very powerful explosion." No group has claimed responsibility for the attack.
One eyewitness, Sayed Moqeed, described the bomber as appearing to be in his early teens. "Suddenly I heard a very big explosion," he said. "Everywhere were pieces of bodies, hands and limbs. The suicide attacker was in police uniform, he looked to be around 14 or 15 years old."
The attack comes on the first of the three-day Eid al-Adha holiday in Afghanistan. Hamid Karzai, the Afghan president, strongly condemned the attack, calling the perpetrators "the enemies of Islam and humanity".
"this attack against innocent worshippers further demonstrates the insurgency’s lack of respect for religion, faith and its disregard for the safety and security of the Afghan people ... Our sympathies go out to those affected by today’s bombing, and we wish a speedy recovery to the wounded".
Northern Afghanistan is relatively peaceful, with the Taliban, who were ousted from power in a US-led invasion in 2001, concentrating their operations in the south and east of the country. Faryab, in the northwest, had also been mostly peaceful.
Last week an Afghan special forces operation killed the Taliban’s shadow governor in the province. Over 20 fighters were also killed in the attack. Sediq Sediqqi, Afghan ministry of interior spokesman, called that operation "very successful" and cited it as a possible basis for Friday's attack.
Recently tribal elders seen as supporting the government have been killed by the Taliban in Faryab. The United Nations says 1,145 civilians were killed in the war in the first six months of this year, blaming 80 per cent of the deaths on insurgents. Last year as a whole, a record 3,021 civilians died in the war, according to UN figures.