Three Spaniards and an Iranian were arrested in Tarragona and Palma de Mallorca in the sting known as Operation Terracota.
The gang members were planning to ship so-called dual-use technologies to Iran before they were found to be in possession of industrial machines for moulding metals, the Civil Guard said in a statement.
The machines can be used for civilian purposes including making fire extinguishers, but they can also produce missile casings and gas centrifuges used for uranium enrichment.
The machines in question had earlier been imported illegally into Spain from the UK and the gang had set up a complex smokescreen for their onward shipment in a bid to flout international sanctions against Iran, the Civil Guard said.
The Civil Guard also seized €10,000 ($13,700) in cash and a mass of documentation about the shipment of dual use technologies.
The gang's members have been charged with belonging to a criminal organization, illegally dealing in materials of dual use and money laundering.