A homicide bomber wearing a burqa attacked a police patrol at a crowded market in western Afghanistan on Thursday, killing at least 12 people and wounding 27 others, officials said.

Police tried to stop the bomber seconds before the blast in the Dilaram district of Farah province, said provincial official Younus Rasoul.

Provincial Gov. Rohul Amin said the bomber was a woman. But the Taliban, who claimed responsibility for the blast, said the bomber was a man named Mullah Khalid.

Five policemen, including a district police chief, and seven civilians were among the dead, Amin said. Another 27 people, including 11 police and 16 civilians were wounded.

Rasoul gave a higher death toll, saying 15 died including 12 civilians. It was not possible to reconcile the differing figures.

Afghanistan is battling a Taliban-led insurgency that is strongest in the east and south. Militants launched more than 140 homicide bombings in the country in 2007, and many of those killed have been civilians.

At least 1,200 people — mostly militants — have died in insurgency-related violence in 2008, according to a tally compiled by The Associated Press. The U.N. says more than 8,000 people, most of them militants, died in insurgency-related violence in 2007.