Pakistan has been battling an Islamist insurgency since 2004 after the US-led invasion of Afghanistan caused militants

At least 21 people were killed and dozens wounded when a Taliban suicide bomber on a motorbike crashed into the main gate of a government office in the northwest Pakistan town of Mardan, officials said.

The blast highlights the Pakistani Taliban's continued ability to carry out attacks despite a major military offensive against its headquarters that analysts say has reduced the group's capacity.

"It was a suicide bomber riding on a motorbike," Faisal Shahzad, district police chief told AFP, placing the number of dead at 21 and wounded at 63.

The explosion ripped through the front entrance of a regional branch of the National Database and Registration Authority (NADRA), which is responsible for issuing ID cards.

Television footage showed the collapsed front wall of the building and twisted metal debris strewn on the road.

Eyewitness Nasir Khan, a 29-year-old labourer who received a shrapnel injury to his right leg, told AFP: "I was standing in the queue waiting for my turn as I had gone to renew my identity card when I heard someone shouting Allahu Akbar (God is greatest) and then I fell to the ground.

"The air was filled with smoke and dust and I could not see anything."

"When the dust settled and I stood up, it looked as though someone had butchered the people in the line, there was only blood and human flesh in the row where people were previously standing."

Ehsanullah Ehsan, spokesman for the hardline Jamaat-ul-Ahrar faction of the Tehreek-e-Taliban Pakistan (Pakistani Taliban) claimed responsibility for the attack in an email sent to AFP.

"This office was attacked because it is an important institution of the infidel state of Pakistan," he said, vowing to carry out further attacks.

- Crackdown on militancy -

Pakistan has been battling an Islamist insurgency since 2004 after the US-led invasion of Afghanistan caused militants to flee across the border where they began to foment unrest.

More than 27,000 civilians and security personnel have died in attacks since that time, according to the South Asia Terrorism Portal, a monitoring site.

But overall levels of extremist-linked violence have dropped dramatically this year, with 2015 on course for the fewest deaths since 2007 -- the year the Pakistani Taliban umbrella group was formed.

Analysts have credited the fall to military operations against the Taliban in the tribal areas of North Waziristan and Khyber where they are headquartered as well as the country's largest city of Karachi.

Authorities have also taken steps to shut down militants' sources of funding and arrested thousands for inciting hatred.

The crackdown came in the aftermath of a Taliban school massacre in December 2014, in which more than 150 people, mainly schoolchildren were killed.
Source: AFP