Three federal police officers died in a shootout with suspected drug traffickers at Mexico City's airport on Monday, as panicked travellers scrambled to take cover amid the latest sign of encroaching violence in the country's capital.

The police moved to detain drug suspects in the airport's Terminal 2 but were attacked, the security ministry said in a statement. Two agents were killed at the terminal and another died of his injuries after being taken to the hospital.

"When the alleged perpetrators were surrounded by the police, shots were fired against the federal agents," the statement said. A police spokesman said he could not comment when asked if there had been any arrests.

Story continues below advertisement

Television footage showed a body lying on the floor in what appeared to be a publicly accessible area of the airport.

More than a dozen shots were heard, prompting many people to seek shelter in fast-food restaurants in the busy facility, Milenio Television reported.

Airport spokesman Jorge Gomez told Milenio that aircraft departures and arrivals continued normally after the incident.

Mexico City has seen relatively low murder rates compared to the rest of the country, where drug violence has killed around 55,000 people in the past five and half years.

Story continues below advertisement

But attacks have been creeping into the capital and its surrounding neighbourhoods, with more than 300 gangland killings recorded last year.

Mexico's airports and ports are busy areas for drug smugglers. So far this year federal police have seized more than 200 kilograms of cocaine at the capital's airport, double the amount taken there last year.