Officials: 40 killed as suicide bomber attacks Afghan mosque Afghan policemen carry the body of a civilian after a blast hit worshipers gathered for prayers in the northern province of Faryab on Friday. KABUL, Afghanistan -- A suicide bomber blew himself up outside a mosque in northern Afghanistan on Friday, killing 40 people and wounding more than 50, government and hospital officials said. The attack in the town of Maymana, capital of northern Faryab province, came as people were gathering at the mosque to celebrate the Eid al-Adha holiday, said Jawid Didar, spokesman for the governor's office. Top provincial officials, including the governor and the police chief, were inside the building when the bomber set off his explosives outside, where a large crowd had gathered, Didar said. The officials were not hurt, but the casualties included police officers and soldiers, he said. "There was blood and dead bodies everywhere," Khaled, a doctor who happened to be in the mosque at the time of the blast, told The Associated Press. "It was a massacre," said Khaled, who like many Afghans uses only one name. The death toll soon climbed to 40, with more than 50 people wounded, a spokesman for the Afghan Ministry of Information told NBC News. Afghan officials told NBC that it was too soon to determine whether Afghan security forces were the primary target of the bomber, or whether the bomber was wearing a uniform of any kind. Afghan woman beheaded for refusing to become prostitute A spate of so-called insider attacks -- carried out by members of the Afghan police or military -- has undermined trust between international troops and the local army and police, further weakened public support for the war in NATO countries and increased calls for earlier withdrawals. Video from the scene showed the motionless bodies of several soldiers and policemen lying next to their vehicles parked on a tree-lined avenue of the city, located about 300 miles northwest of Kabul. On the sidewalk, a number of civilians lay along the mosque's outer wall, some writhing and moaning in pain. Intensifying violence Friday's attack appeared to be the deadliest suicide bombing in recent months. But 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 by the end of 2014. 4, 25 civilians were killed and more than 35 wounded in Nanghar province, and on Sept. 1, 12 people were killed and 47 wounded in a suicide attack in Wardak province. The attack came as Afghan President Hamid Karzai urged Taliban insurgents "to stop killing other Afghans." In his Eid al-Adha message to the nation, Karzai called on the insurgents to "stop the destruction of our mosques, hospitals and schools." Pakistani girl shot by Taliban reunited with family The United Nations says that Taliban attacks account for the vast majority of civilian casualties in the war. The insurgents routinely deny that they are responsible for attacks on civilians, saying they target only foreign troops or members of the Afghan security forces. On Wednesday, Taliban leader Mullah Mohammad Omar urged his fighters to "pay full attention to the prevention of civilian casualties," saying the enemy was trying to blame them on the insurgents. Taliban claims killing of 2 Americans Also Friday, the Taliban claimed responsibility for killing two American service members in southern Uruzgan province, in what may have been the latest insider attack against Western troops. In an emailed statement, Taliban spokesman Jusuf Ahmadi said a member of the Afghan security forces shot the two men the day before, then escaped to join the insurgents. Maj. Lori Hodge, spokeswoman for U.S. forces in Afghanistan, said on Thursday that authorities were trying to determine whether the attacker was a member of the Afghan security forces or an insurgent who donned a government uniform. It was the second suspected insider attack in two days. On Wednesday, two British troops and an Afghan policeman were gunned down in Helmand province. Before Thursday's assault, 53 foreigners attached to the U.S.-led coalition had been killed in attacks by Afghan soldiers or police this year.