They suspect the cell of trying to send people to join the Islamic State in Iraq and the Levant (ISIS), a jihadist militant group.
Raids were carried out in Madrid in the early hours of Monday, officials say.
The cell's leader was once held at the US detention centre at Guantanamo Bay in Cuba after being arrested in Afghanistan, a statement said.
Unconfirmed reports in Spanish media named him as Lahcen Ikasrrien, a Moroccan national who was released on his return to Spain in 2005 for lack of evidence.
One of the seven other people arrested is believed to be from Spain. Another is from Argentina and the remaining five from Morocco.
Police were also reported to be hunting the brother of one of the Madrid bombers. Attacks carried by Islamist militants on four trains in March 2004 left 191 people dead and another 1,800 people hurt.
Spanish police have carried out a series of raids against suspected militants in recent months.
A number of people were arrested last month in Spain's north African enclave of Melilla on suspicion of trying to recruit fighters for Islamist militant groups in Libya and Mali.
Although Monday's arrests were not thought to be linked to potential domestic attacks, Spanish police are said to be stepping up security ahead of the proclamation of Prince Felipe as king later this week.
Spain is, however, concerned about the threat of "blowback" from the conflict in Syria and the Sunni rebel offensive led by ISIS in Iraq, which has led to the capture of a number of towns and cities.
At the weekend, a French national was detained by German police on suspicion of fighting for militants in Syria. He was arrested as he arrived in Berlin on a flight from Istanbul.
Belgian police investigating the murder of four people at the Jewish Museum in Brussels are seeking the extradition from France of a militant who spent a year fighting in Syria.
The Dutch government revealed on Monday that many Islamist fighters from the Netherlands had joined ISIS