Security forces managed to quickly repulse the attack on the complex, which serves as a training academy for airport security forces, officials said.
Pakistani television stations showed images of security guards rushing to the scene and frantically taking up positions behind buildings or earthen berms in the neighbourhood roughly one kilometre from Karachi's Jinnah International Airport. The Pakistani military said army troops were sent to help the security forces after the shooting.
A spokesman for the Airport Security Force, Ghulam Abbas Memon, said about two to three gunmen tried to enter a training academy complex for the security forces from two different entrances.
''Our men retaliated and repulsed,'' the gunmen, Memon said, adding that security forces chased the men to a drainage ditch near the academy where another firefight ensued but the gunmen managed to escape.
''Now a search operation is under way,'' he said.
A senior official with the Airport Security Force (ASF), Col Tahir Ali, said two militants fired toward a hostel for female employees on the academy grounds and fled toward the nearby slums that surround the airport.
''We cannot take any risks and allow terrorists to get into our facility,'' he said, speaking on Pakistani television. He said no one was hurt in the incident. ''Whenever there is such an incident, we will react forcefully.''
A spokesman for the Pakistani Taliban claimed responsibility for the shooting in a telephone call to The Associated Press and warned that it ''wasn't over yet.''
The Civil Aviation Authority, which is responsible for running the country's airports, initially said in its Twitter feed that all flights at the airport were suspended because the academy for the ASF was under attack but later reported that operations had resumed.
The head of ASF, Azam Khan, said the media had blown the incident out of proportion. ''The aim of the attackers was to create a panic and we shouldn't be playing into their hands,'' he told Pakistani television.
Tuesday's firefight came on the heels of a brazen siege by the Taliban who on Sunday night stormed a VIP and cargo terminal at the Karachi airport in an attack that killed 36 people, including the 10 Taliban gunmen. At least 11 members of the Airport Security Force were killed during that attack.
Pakistani authorities were still discovering bodies from that siege on Tuesday morning. Airport authorities found seven bodies in a burned building at the Karachi international airport, and brought the remains to the city's Jinnah Hospital. They were charred beyond recognition, said the head of the Karachi Municipal Corporation, Rauf Akhtar Farooqi.
The discovery of the bodies inside a cold storage unit in a burned building in the airport, roughly a day after Pakistani officials said the airport had been secured, is sure to raise more questions about security at the country's busiest airport.
Pakistani media were reporting that the seven were airport workers who had hidden inside the unit from the fighting but got trapped and burned to death.
The head of the Civil Aviation Authority, Mohammad Yusuf, said authorities tried to reach to the building that was on fire twice during the siege but both the times shots were fired on their vehicles. After security officials cleared the airport, they went back to search the building because there were reports of people trapped inside.
The Pakistani Taliban has been trying to overthrow the government and establish its hard-line rule across the country. The government of Prime Minister Nawaz Sharif has tried repeatedly to negotiate with the militants to end the fighting but those efforts have gone off the rails in recent weeks.
The airport attack, coming against a high-profile target in a city vital to the country's economy, has raised questions about whether Sharif will continue to pursue the negotiations policy or choose a more aggressive, military response.