PESHAWAR, Pakistan -- Islamist militants stormed a provincial government complex for agriculture research in the northwestern 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 said.

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

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

Get Breaking News Delivered to Your Inbox

Mahsud said three attackers clad in women's burqas 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 injured.

Pakistani security personnel take position outside an Agriculture Training Institute after an attack by Taliban militants in Peshawar, Dec. 1, 2017. Getty

TV footage showed bullets holes in building walls, blood stains 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 over a week after a suicide bomber killed top police official Mohammad Ashraf Noor and his guard in the provincial capital.

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 police and military troops quickly cordoned the building, closed in and killed the gunmen who had holed up in a building in the complex. 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 critical condition, authorities said.

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

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

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