Pakistani security personnel gather near the Peshawar airport on Dec. 15, 2012. Militants fired rockets into the airport late on Saturday, killing four people, wounding dozens more and forcing the airport to close, officials said. (A MAJEED/AFP/GETTY IMAGES)

A rocket attack on the airport of this city in northwestern Pakistan, near the Afghan border, Saturday night left at least three civilians and five militants dead and wounded more than three dozen people, security officials said.

The militants used rocket-propelled grenades and automatic weapons in the attack that lasted more than an hour, the officials said. Three rockets landed on airport premises and two in the neighboring civilian area.

Pakistani Taliban, also known as Tehrik-i-Taliban Pakistan, claimed responsibility for the attack.

“Peshawar air base was our target,” Ehsanullah Ehsan, spokesman for the group, said in a statement. He said 10 attackers took part in the operation.

A spokesman for the Pakistani air force said the attackers’ target was the military base attached to the Bacha Khan International Airport. Helicopter gunships, used for security operations in the nearby lawless tribal areas, are based there.

The air force spokesman said security troops repulsed the attack, and the attackers could not enter the base and airport premises. None of the rockets landed inside the main airport area, a spokesman for the Civil Aviation Authority told the Associated Press. No planes were damaged and no air force or airport officials were hurt in the attack.

An official at the Khyber Teaching Hospital said four civilians were killed and nearly 40 injured, but rescue officials confirmed three dead and 31 wounded. The dead and wounded were residents of neighborhoods near the airport.

Mian Iftikhar Hussain, the information minister of Khyber Pakhtunkhwa province, where Peshawar is the capital, said five of the attackers were killed, including four in a car targeted by security forces after the rocket attack. Hussain told the AP that two of the rockets damaged a wall that surrounds the airport, and a third landed near a government building outside the premises. Two other rockets landed in a nearby residential neighborhood.

A gun battle broke out between security forces and militants after the rocket attack, he said.

Security and civil aviation officials said the Pakistani military has taken control of the airport and flights have been diverted to other airports.

Hussain said all roads leading to the airport have been blocked and the neighboring areas are being searched. He said there were intelligence reports of the attack, and a suicide bomber was also arrested at the airport area a few days ago.

Pakistani Defense Minister Naveed Qamar said in a statement that some suspected terrorists were reported to have taken shelter in a house near the airport.