Three Guardia Civil and two Policia Nacional agents sustained injuries while arresting drug traffickers in the Botavara neighbourhood in Algeciras.
It came after they witnessed smugglers picking up a shipment of hashish from a narco boat on El Rinconcillo beach at 5.30am yesterday.
They followed the suspects to their hideout in Algeciras, but when they tried to arrest them, dozens of locals attacked the officers.
Police still managed to arrest seven suspects.
The drug shipment and a stolen van were seized in the raid.