Two police officers and three civilians were wounded when two officers engaged in a shootout in a neighborhood in the northern section of Mexico City, prosecutors said.

The shootout happened Monday in Progreso Nacional, a neighborhood in the borough of Gustavo A. Madero, when Federal District police investigator Erick Omar Martinez Garin fired on Enrique Ambrosio Estrada, a member of the State Security Agency, or ASE, from neighboring Mexico state, which surrounds the district and forms part of the Mexico City metropolitan area.

The initial investigation determined that Martinez Garin was leaving work and heading to the home of relatives "when he was alerted by some neighbors to the presence of an armed subject, dressed in civilian clothes, around a pharmacy," the Federal District Attorney's Office said in a statement.

Martinez Garin approached a delivery vehicle outside the pharmacy and was attacked by the suspect, leading to an exchange of fire.

The Mexico City officer was shot in the abdomen and the ASE officer was hit in the chest.

A civilian was shot in the left knee, another was hit in the right hand and a third was shot in the abdomen.

All five people were hospitalized and the two officers are being investigated for their roles in the incident, prosecutors said.

Estrada, the ASE officer, was guarding the delivery vehicle, press reports said.

The Mexico City metropolitan area sprawls across several states, sometimes leading to conflicts between authorities from the capital and those from neighboring jurisdictions.

The Federal District Attorney's Office, for example, is currently investigating a Mexico state Attorney General's Office agent who allegedly stole items from a house during an operation to arrest a drug trafficker.