Three police officers ended up being rescued by a group of suspected drug traffickers they were chasing at sea on Friday after their boats collided off the coast of Spain, officials said.

The Civil Guard said in a news release the incident happened off the coast of Costa del Sol, after Spanish maritime patrol agents were trying to intercept a boat suspected of carrying drugs that had four people on board.

During the chase, officials said both vessels collided, causing three police officers to fall into the water after the agent's boat went "out of control."

SUSPECTED DRUG SMUGGLERS CLUNG TO FLOATING BALES OF COCAINE FOR HOURS IN SHARK-INFESTED WATERS: COPS

A police helicopter then hovered overhead and called on the four suspected drug traffickers to help using a megaphone. The group then helped pull the officers to safety.

"The crew of the helicopter of the Malaga Air Unit, upon realizing the imminent danger to the civil guards, required the occupants of the other vessel to support them by public address, being rescued by them and being all unharmed," police said in a news release.

'EL CHAPO' RIVAL CHARGED WITH DRUG CRIMES, LEADING 'CONTINUING CRIMINAL ENTERPRISE'

Even though they helped rescue the officers, the four men were arrested for drug trafficking.

CLICK HERE FOR THE NEW FOXBUSINESS.COM

Authorities recovered more than 80 bundles of hashish that had fallen to the sea that weighed more than 3 tons, according to the Civil Guard.