Spanish police arrested four drug traffickers who stopped to save their lives after the officers were thrown overboard during a high speed boat chase off the coast of Malaga on Friday.

The three police officers fell into the sea following a collision with the trafficking boat during the chase, a Guardia Civil statement said.

A police helicopter hovering overhead appealed to the speedboat via megaphone to stop and help the officers after their boat "span out of control", and the traffickers did so, pulling the agents to safety unharmed.

However, when police found three tonnes of hashish in the waters nearby, the rescue did not appear to work in the traffickers' favour. The four on board were arrested regardless.

"They were arrested for drug trafficking," a police statement said, indicating that more than 80 bundles of hash had been recovered from the sea.

In a video posted by the Guardia Civil, the boats can be seen zooming across the open ocean before the semi-inflatable trafficking boat turns into the path of the police vessel, forcing it to turn sharply, throwing the three officers overboard.

The video taken from the police helicopter then shows the officers bobbing around in the water below, before a wide shot shows the drug bundles floating nearby.