At least three civilians and five suicide attackers were killed when a group of heavily armed Taliban fighters attempted to storm the airport in the northwestern city of Peshawar after firing five rockets, officials said.
The militants, who were armed with assault rifles and were wearing suicide vests, tried to enter the Bacha Khan International Airport, but the attempt was foiled by Pakistani security forces.
Three of the rockets landed inside the airport but did not cause any major damage while two more hit nearby residential areas at around 8.30 pm.
The attackers also rammed an explosives-laden vehicle into the wall of the airport, which is used by civilian flights and the Pakistan Air Force.
Troops posted in the area retaliated and footage beamed by TV news channels featured the sound of an intense exchange of fire.
Officials of the Khyber Teaching Hospital said they had received the bodies of three civilians and more than 40 have been injured.
Defence Minister Naveed Qamar said the attack was well planned and the terrorists were heavilyarmed. However, the response by the security forces ensured there had been no damage to property or loss of life within the airport.
Senior official Umar Ayub described the condition of four of the wounded as serious.
Children, women and senior citizens were among the injured, who were hit by bullets and shrapnel from rockets.
Security officials said five terrorists were killed in the gun battle with troops. Bomb disposal experts defused four suicide jackets.
"Security forces were fully alert and they responded to the attack. There is no damage to equipment and personnel," a Pakistan Air Force spokesman said in a statement.
The banned Tehrik-e-Taliban Pakistan has claimed responsibility for the attack.
A spokesman for the group told reporters that the target of the attackers was the PAF airbase.
The terrorist attack on the airport was launched from a nearby village named Abdra, the PAF spokesman said.
The rockets fired by the attackers damaged the airport's outer wall at a few places but "no terrorist has been able to penetrate inside", the spokesman further said.
Officials of the Civil Aviation Authority said the airport was shut down after the attack began and all flights coming to Peshawar were diverted to Islamabad and Lahore.
They said all people and civilian aircraft inside the airport were safe.
Additional security forces were deployed around the airport and troops searched houses in nearby neighbourhoods.
Pak girl admitted to hospital 10 days after being raped
Hafeez confident Pakistan can pocket India series
MEET Qamar Hashim, the 8-year-old photographer
Umar Akmal fined for disrespecting umpires
India, China to lead aviation industry growth: IATA