Police seized Yassin Ahmed Laarbi in the Spanish territory of Ceuta, which borders Morocco, on terrorism charges, the interior ministry said in a statement.
Laarbi, a Spanish national also known as Pistu, is accused of leading a group that sent about 50 jihadists to Syria, some of whom carried out suicide attacks.
"He is suspected of having been the top leader of an active network that recruited and radicalized mujahedeen and martyrs and sent them to terrorist groups in Syria," the statement said.
Police had detained eight other members of the cell in Ceuta in June but had not got hold of Laarbi, who was not at home when officers came for him during those raids.
The network, operating in Ceuta and the neighbouring Moroccan town of Fnideq, was suspected of sending dozens of Islamist militants, including minors, to join "Al-Qaeda-linked terrorist groups operating in Syria", the ministry said at the time.
It said that some of those sent by the group carried out suicide attacks.
Laarbi himself "was a candidate to join terrorist groups in Syria", Monday's statement added.
European Union governments have expressed alarm at what they say are hundreds of young Europeans believed to be fighting alongside rebels in Syria.
Police also this month arrested a "suspected jihadist terrorist" wanted by Morocco in Spain's other north African enclave, Melilla.