Updated

A suicide bomber blew himself up outside a mosque in northern Afghanistan on Friday, killing 35 people and wounding at least 70, 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," said Khaled, a doctor who happened to be in the mosque at the time of the blast. "It was a massacre," said Khaled, who like many Afghans uses only one name.

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.

It appeared to be the deadliest suicide attack in recent months.

On Sept. 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."

The United Nations says that Taliban attacks account for the vast majority of civilian casualties in the 11-year 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.

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.

A spate of insider attacks has undermined trust between international troops and Afghan army and police, further weakened public support for the 11-year war in NATO countries and increased calls for earlier withdrawals.

Maj. Lori Hodge, spokeswoman for U.S. forces in Afghanistan, said on Thursday that authorities were trying to determine whether the latest 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.