Interior Minister Angel Acebes said three Moroccans and two Indians were detained.
At a press conference late on Saturday, the minister said the five were arrested in connection with a cell phone found inside an explosives-packed gym bag found on one of the bombed commuter trains.
All the detentions were made "for presumed implication in the sale and falsification of the phone and SIM cards found in the bag".
Two Spaniards of Indian origin are also being questioned, but are not expected to be arrested, Acebes said.
"This is an open investigation which is only just starting. At the moment there is a search going on in various buildings and homes.
"It's the beginning of the investigation, but it opens an important path to advance down ... I give you this information with a lot of caution and prudence."
Following the arrest of three of its nationals, Morocco announced its security officials would visit Spain to help the investigations.
"A high-level security delegation will visit Spain early on Sunday to take part in investigations into the attacks and confirm the identities of the Moroccan suspects," Communications Minister Nabil Abd Allah said.
Earlier in the day, traumatised Spaniards started burying those killed in the blasts.
The nation's grief was crystallised on Saturday at a funeral service in Alcala de Henares, home to 40 of those killed in Thursday's atrocities. It was supposed to be an official "day of reflection" prior to the general election.
"Death penalty for the terrorists," said a weeping Violeta Dominguez, whose daughter lost a friend.
Spain does not have a death penalty and Prime Minister Jose Maria Aznar has said he is personally against it.
Demonstrating the depth of feeling in Spain, the government said 11.64 million people - more than a quarter of Spain's population - had taken to rain-drenched streets in nationwide protests on Friday against "our September 11".
Meanwhile, a Spanish radio station on Saturday said Spain's intelligence service is "99% certain" that Islamist and not Basque fighters carried out the bombings.
The van suspected of being part
of the deadly attacks
The report by private radio SER, whose owners have links to the opposition Socialists, went against government claims that the Basque armed group ETA was the prime suspect in the attacks.
It fuelled grumbling from critics that Aznar's government might be focusing on the Basque group, rather than al-Qaida, for internal political gain in advance of Sunday's election. Ministers angrily denied the charge.
Finding the culprits for the attacks has huge global security implications. If it was al-Qaida, it would be the first strike in the West since the 11 September 2001 attacks in the United States.
If it were ETA, it would be a major escalation for a group that has killed 850 people in Spain over 36 years and is listed as a terrorist group by the US and European Union.
It could also sway Spain's general election, going ahead on Sunday as planned after three days of official mourning.
Aznar's centre-right government stands to win votes if the culprits were ETA, because it has campaigned on its hardline stance against the armed Basque group, political analysts said.
If al-Qaida or other Islamist groups were shown to be involved, voters might perceive the attacks as the price for Aznar's domestically unpopular support of the Iraq war. But they might also rally around a government seen as strong on security.
Citing high-ranking officials, SER radio said the National Intelligence Centre (CNI) believed evidence pointed to an Islamist group and that 10 to 15 people left bombs on trains and fled.
“The evidence has wiped out previous indications that led us to believe in ETA," the radio quoted one source as saying.
The change came after a van was found later on Thursday, near the Alcala de Henares station where three of the four bombed trains originated, with an audio tape lesson about the Quran and seven detonators inside, the radio station said.
A group tied to al-Qaida has claimed responsibility for the attacks and ETA has denied it, but neither statement has been confirmed to be genuine.