ISLAMABAD (AP) -- At least half a dozen suicide bombers armed with automatic weapons and rocket-propelled grenades attacked a major air force base in northern Pakistan before dawn Thursday, sparking a heavy battle that killed two security personnel and left parts of the base in flames, officials said.

The attack on the base in Kamra, located only about 40 kilometers (25 miles) northwest of Islamabad, was a brazen reminder of the threat posed by Islamist militants in Pakistan despite numerous military offensives against their sanctuaries along the Afghan border. The base hosts a variety of fighter jets, including F-16s, and also contains a large factory that makes aircraft and other weapons systems.

The militants infiltrated the base under the cover of darkness and began battling security forces at around 2 a.m., according to the Pakistani air force. Other militants fired rocket-propelled grenades at the base from outside, damaging one aircraft.

Security forces fought the militants for two hours and were finally able to retake the base, the air force said. The militants did not reach the hangars inside the base.

Six militants wearing explosives and two security personnel were killed in the fighting. The head of the base, Air Commodore Muhammad Azam, was wounded. Security forces are searching the area for any militants who may have escaped, said the air force.

No group has claimed responsibility for the attack, but suspicion will likely fall on the Pakistani Taliban, who have waged a bloody insurgency against the government for the past several years that has killed tens of thousands of people.

While the group has carried out hundreds of bombings and other attacks through the country, raids against military bases are somewhat uncommon.

Half a dozen Taliban militants attacked a major naval base in the southern port city of Karachi in May 2011, killing at least 10 people and destroying two U.S.-supplied surveillance aircraft. It took Pakistani commandos 18 hours to retake Naval Station Mehran, and two of the attackers managed to escape. That the attackers managed to infiltrate so deep into the high-security base led to speculation they may have has inside information of assistance.

In 2009, militants dressed in fatigues attacked army headquarters in the city of Rawalpindi, just outside Islamabad, and took 30 people hostage. Pakistani commandos finally raided the compound 22 hours later. Three captives and four militants were among those killed.

There have been at least three attacks in the vicinity of the Kamra air force base since 2007, but all of them occurred outside the installation.

In 2009, a suicide bomber on a bicycle blew himself up on a road leading to the base, killing seven people. A year earlier, three rockets were fired at an area near the base, but no one was hurt. In 2007, a suicide car bomber wounded five children on an air force bus carrying them to school near the base.

The Pakistani army has carried out numerous offensives against the Pakistani Taliban in the country's semiautonomous tribal area along the Afghan border and appears to be planning an operation in the group's last major sanctuary in North Waziristan.

U.S. Defense Secretary Leon Panetta told The Associated Press earlier this week that Pakistan has informed American military officials that it plans to launch an operation against the Pakistani Taliban in North Waziristan in the "near future."

It's unclear if the attack on the base in Kamra was conducted in response to the upcoming operation.