Taliban militants beheaded a teacher in a central Afghan town while his wife and eight children watched, officials said Wednesday, describing the latest in a string of attacks targeting educators at schools where girls study.

Four men stabbed Malim Abdul Habib eight times late Tuesday before decapitating him in the courtyard of his home in Qalat, said Ali Khail, a spokesman for the provincial government of Zabul, where the attack took place.

The assailants made Habib's wife, four sons and four daughters watch, Khail said. His children were between the ages of 2 and 22. No other family members were hurt.

The insurgents killed Habib, 45, after he refused to go with them to meet their commander, said the victim's cousin, Esanullah, who goes by only one name.

The attackers fled and Habib's wife called the police, Khail said. Police are questioning three people who were guests in the victim's home at the time.

Habib was the headmaster of Shaikh Mathi Baba high school, which is attended by 1,300 boys and girls.

Zabul, a remote and mountainous province populated mainly by Pashtuns and bordering Pakistan, is a hotbed of Taliban militancy. The former Taliban regime prohibited girls from attending school as part of its widely criticized drive to establish what it considered a "pure" Islamic state.

Zabul province's education director, Nabi Khushal , blamed Taliban rebels for the killing.

"Only the Taliban are against girls being educated," he said. "The Taliban often attack our teachers and beat them. But this is the first time one has been killed in this province."

Cleric Sayed Omer Munib, a member of the nation's top Islamic council, said there was no justification in Islam's holy book, the Quran, to prevent girls from studying.

"Nowhere in the Quran does it say that girls do not have the right to education," he said. "It says that 'people should be educated.' This means girls, too."

Hundreds of thousands of girls have returned to school since U.S.-led forces ousted the Taliban in 2001.

A UNICEF spokesman said the attacks were "incredibly worrying."

"Militants are clearly trying to intimidate communities and force families not to send their girls to school," Edward Carwardine said. "We hope these incidents will not deter families. ... Fortunately, so far we have not seen a decline in girls attending."

He said about 90 percent of Afghan adults are believed to support educating girls. Many of those who oppose it are in conservative rural areas dominated by ethnic Pashtun where the Taliban — who also are Pashtun — are most powerful.

The government condemned the killing. Masood Khalili, the Afghan ambassador to Turkey, where President Hamid Karzai was visiting, said it was "disgusting action by the enemies of Afghanistan."

Esanullah said Habib resumed a more than 20-year teaching career two years ago after the Taliban threatened him while he was working for an aid group helping the disabled. Since then, the Taliban had warned him twice to stop teaching.

Habib's funeral Wednesday was attended by hundreds of students and teachers.

Taliban spokesmen and commanders in the region, one of the most volatile in Afghanistan, could not immediately be reached for comment.

In the past year, Taliban insurgents have occasionally put up posters around Qalat demanding girls' schools be closed and threatening to kill teachers, Khushal said.

He said 100 of the province's 170 registered schools have been closed in the past two to three years because of poor security. Of the 35,000 students attending schools in Zabul, 2,700 were girls, he said.

There has been a series of attacks on girls' schools and teachers across Afghanistan since the Taliban regime fell. In October, gunmen killed a headmaster in front of his students at a boys' school in southern Kandahar province, the former stronghold of the Taliban regime.