The operations were carried out in conjunction with Belgian and Moroccan police.
At least three of those arrested were suspected of links to the Belgian suicide bombings in March of last year, which killed 31 people at the Brussels airport and on a metro train, Spain's High Court said in a statement.
The nine arrested men were Moroccan apart from one Spaniard and were aged between 30 and 40, the police said. Most already had criminal records related to organised crime such as drug trafficking.
Most had lived for more than 20 years in the northeastern region of Catalonia, although they often returned to Morocco for visits, the court said.
House searches turned up documents, computers and memory drives that will now be analysed by authorities, as well as at least three guns and drugs including marijuana, the police and court said.
Raids of houses in Morocco connected to the men are currently underway in collaboration with Moroccan police, the police said.
The raids follow an eight-month investigation of a group of suspected militants with links to organised crime in the Barcelona area, the police said. The investigation remains open.
Police said they started tracking the gang as a result of a tip-off from a member of the public. The tip-off was an anonymous call to police from a member of the public concerned about drug trafficking, La Vanguardia newspaper said.
Not including Tuesday's arrests, Spain has detained 22 people in 16 separate operations this year in connection with extremism, according to Interior Ministry figures.