Islamist militants stormed a provincial government complex for agriculture research in the north-western Pakistan city of Peshawar on Friday, killing nine students and wounding 35 others, police and rescue officials said.

Police and military troops killed five attackers during a firefight and while clearing the complex, they added.

The main Taliban militant group, Tehrik-e-Taliban Pakistan, claimed responsibility.

Soldiers take position outside the agriculture institute
Soldiers take position outside the agriculture institute (Muhammad Sajjad/AP)

Police chief Salahuddin Mahsud, of Khyber Pakhtunkhwa province, said attackers opened fire on the main gate of a provincial Agricultural Department complex, initially injuring two guards and two students.

Mr Mahsud said three attackers wearing women’s burkas then reached the gate in a rickshaw and opened fire to clear their way to the building. The ensuing firefight left nine dead and dozens more wounded.

TV footage showed bullet holes in building walls, bloodstains and broken glass scattered on the floor.

A comparatively small number of students and others were present in the normally crowded complex at the time of the attack because Friday is a holiday, the day when Muslims celebrate the birthday of the prophet Muhammad.

The attack came a week after a suicide bomber killed top police official Mohammad Ashraf Noor and his guard in the provincial capital.

More than 30 people were wounded in the attack
More than 30 people were wounded in the attack (Muhammad Sajjad/AP)

Pervez Khattak, chief minister of Khyber Pakhtunkhwa province, expressed grief over the nine lives lost.

“These terrorists have no religion as they attacked on a day which is very sacred and the nation was celebrating it,” he said.

The police chief said officers and troops quickly cordoned off the complex, closed in and killed the gunmen who had holed up in a building. The complex includes offices, a teaching institute and a hostel.

Among the wounded were two soldiers, seven policemen, a reporter and a private guard in addition to the students. Some were in a critical condition, authorities said.

Provincial health minister Shahram Khan confirmed the deaths of nine people, with 35 wounded.

Mr Mahsud said dozens of students and others were rescued during the operation. He said that, after eliminating the attackers, troops were searching and clearing the buildings.

During the clearance operation, security forces seized an explosive vest, hand grenades and several assault rifles that the attackers had been carrying.