Spanish police arrested 30 people accused of robbing, kidnapping and torturing drug traffickers, the Interior Ministry said on Monday.
Police detained 21 Moroccans, eight Spaniards and one person from Senegal and are investigating another five people, it said.
Those detained are accused of fixing tracking devices to drugs sold to the traffickers before they left Morocco en route to Spain, where members of the group, dressed as security officials, confiscated the drugs.
The suspects also kidnapped and tortured traffickers for information on other drugs stashes, the ministry said, adding the drugs were then exchanged in France for weapons and ammunition.
In raids across Spain, more than two-and-a-half tonnes of hashish, 16 vehicles, more than 60,000 euros (£46,451) in cash, six guns and mobile phones were confiscated, the ministry said.
The operation was carried out by the Spanish police in collaboration with Catalonian and Moroccan security forces, the Interior Ministry said.