The gang is suspected of selling heroin to other traffickers in Spain's wealthy northeastern region of Catalonia as well as directly to users, Catalan police said in a statement.
The ring would transfer its profits to Morocco where its leaders would launder the money by buying real estate, the statement added.
Among those detained as part of the operation was the suspected leader of the group, a Moroccan national.
"This heroin seizure... Is the biggest ever carried out by Catalan police and the biggest in Spain in 2014," the statement said.
Police said they opened their investigation in February after officers detected an "important point of sale for heroin" in the town of El Vendrell, about 70 kilometres (40 miles) south of Barcelona where the ring was based.
They monitored the site and swooped in to make their arrests on October 16 when a shipment of heroin was due to arrive from The Netherlands.