The officer was injured in Algeciras when he engaged fire with a suspected drug dealer, causing the whole surrounding area to be cordoned off.
Cops thought they had the suspect surrounded inside a house, but when they stormed the property, there was no one inside.
There have yet to be any arrests by Policia Nacional, who have overtaken the investigation, but a stash of drugs has been located.
The officer is recovering at the Punta Europa Hospital but his injuries are not thought to be critical.
The police operation began this morning when the officers of the Málaga command moved into the Antonio Machado and Ponce de León streets in the El Saladillo neighborhood in an anti-drug raid.
Shots were fired from a house that was quickly surrounded by agents.
A tourist dodged bullets as he became caught in the crossfire, while two other vehicles were also struck.
Several dozen officers were involved in the operation.
The operation is under secrecy and is part of a campaign to weaken the influence of drug gangs in the Campo de Gibraltar area.
Policia Nacional said: “Over the past few months the tension in the Campo de Gibraltar region has increased again.”
They say that this increase has ‘taken advantage of the fact that public opinion, media and political authorities have been distracted by Catalunya.’
The police force insists that the Campo de Gibraltar has for years been in need of considerable increases in staff to fight the drug trafficking effectively.