PESHAWAR, Pakistan (Reuters) -Islamist militants attacked a military base in northwestern Pakistan, killing eight security personnel, the military said on Tuesday, after a suicide bomber rammed a vehicle loaded with explosives into a perimeter wall.

The attack, which occurred on Monday, coincides with a resurgence of Islamist militancy in the restive northwest border region with Afghanistan, which last month prompted the government to launch a counter-insurgency operation in the area.

Militants targeted the base in Bannu, on the border with the tribal area of North Waziristan, which is known as a hotbed of Islamist militancy, and is close to the Afghanistan border. Security forces killed all 10 assailants involved, the military said in a statement.

"This timely and effective response ... prevented major catastrophe, saving precious innocent lives," the statement added.

Among the dead in Monday's attack were seven army members and one paramilitary soldier.

The British colonial era military base has historically been used as a launch pad for anti-militant operations, and is surrounded by civilian dwellings, which were shaken by the loud explosion from Monday's blast, two local officials told Reuters.

They said the initial blast was used to take down the perimeter wall to allow the other militants to enter the base.

The attack was claimed by the Hafiz Gul Bahadur Group, which the military said operates out of neighbouring Afghanistan "to orchestrate acts of terrorism inside Pakistan".

A spokesman for Afghanistan's Taliban administration did not immediately respond to a Reuters request for comment.

Islamabad says it has consistently taken up the issue of cross-border attacks with the Taliban administration, which denies allowing Afghan soil to be used for attacks.

The matter has escalated tensions between the neighbouring countries, leading to clashes between their border forces. The militant group involved in the latest attack was the same one targeted by Pakistan in a rare cross border operation.

"Pakistan Armed Forces will...take all necessary measures as deemed appropriate against these threats emanating from Afghanistan," the military said on Tuesday.

(Reporting by Gibran Peshimam in Karachi and Mushtaq Ali in Peshawar; Editing by Jacqueline Wong and Clarence Fernandez and Miral Fahmy)

By Mushtaq Ali and Gibran Naiyyar Peshimam