MADRID — The Spanish authorities on Thursday announced the seizure of about 20,000 military uniforms that were being shipped from Spanish ports to fighters with the Islamic State and other Islamist groups, according to the Interior Ministry.

The uniforms were part of a shipment declared as “secondhand clothing” to pass through customs, the ministry said, and were hidden inside three shipping containers intercepted in the ports of Valencia and Algeciras. Some other military accessories were also seized.

The ministry said in a statement that the seizure was linked to the arrest in early February of seven people accused of operating a logistical support network that provided military equipment to the Islamic State as well as the Nusra Front, a branch of Al Qaeda operating in Syria.