Madrid (CNN) -- A Spanish judge on Monday ordered eight suspected Islamic militants to remain in prison on preliminary charges alleging membership in a terrorist group, a National Court spokesman told CNN.
The eight, arrested Friday in the Spanish enclave of Ceuta on Morocco's north coast, organized "a structure based in Spain, with connections in Morocco, Belgium, Turkey and Syria, dedicated to radicalizing, recruiting and sending mujahedeen (fighters) to Syria with the aim of conducting jihad and achieving martyrdom," the judge handling the case, investigating magistrate Ismael Moreno, wrote in a court order viewed by CNN.
The group has connections to the Jabhat al-Nusra front, described as an active al Qaeda group in and around Syria, and to the Iraq Islamic State in Iraq, but "there are increasing references to carrying out jihad at home," the judge warned, referring to potential attacks in Spain.
The suspects sent at least 12 Spanish or Moroccan males, from both Ceuta and Morocco, to fight in Syria, the judge wrote. At least five died in suicide attacks in Syria that caused numerous casualties. One of the males was a minor; it was not immediately clear if he was among those who had died.
Some of the eight suspects intended to go themselves to Syria, the judge added.
The court provided a copy of Moreno's order for continuing confinement for the suspected leader of the eight, identified as Spaniard Karin Abdeselam Mohamed, 39.
A court spokesman, who by custom is not identified, said the judge's orders for the other seven suspects were similar, although they were not made public.
One of the eight also faces preliminary charges of weapons possession. That was not the suspected leader, but the spokesman did not identify which of the remaining suspects faces this preliminary charge.
A CNN phone call and text message to a lawyer thought to be representing the eight was not immediately answered.
The eight appeared, one by one starting Monday morning, in closed-door hearings before the judge at the National Court, which handles terrorism cases, in Madrid.
Spanish police Friday said the group was based in Ceuta and in the nearby Moroccan city of Fnideq. Cueta is an autonomous city of Spain that borders Morocco.