The authorities detained two Spaniards and a British national they believe headed the ring as part of the operation, and seized nearly 3.3 tonnes of hashish from several warehouses in the village of Llinars del Valles in the northeastern region of Catalonia, police said in a statement.
The network is suspected of setting up a system that "used warehouses that had been seized by banks to produce drugs and as a base for drug trafficking operations", the statement said.
It allegedly shipped the hashish by truck to other European nations hidden among pallets of fruits and vegetables.
Police began their investigation after receiving a tip that a warehouse in Llinars del Valles was possibly being used to grow marijuana.
When officers searched the warehouse they found a "big and very sophisticated hydroponic plantation of marijuana". It was connected to other nearby warehouses which were also found to be used to produce marijuana.
Authorities suspect the ring stole 430,000 euros ($506,000) of electricity to grow the plants.
The three suspects have been charged with drug trafficking, drug manufacturing and electricity theft.
Warehouses used by the ring are in the hands of several different banks which police did not name.
The collapse of a decade-long building boom in 2008 left Spanish banks saddled with billions of euros in property and soured loans to developers.
Squatters have illegally occupied many repossessed properties in the hands of banks.
Lenders sometimes disable elevators and tear out stairwells in their apartment blocks to prevent entire buildings from being occupied.