A video tape, purportedly from the Islamist network, also threatened more reprisals in the weeks to come, according to Spanish officials on Sunday.
Interior Minister Angel Acebes said police were studying the reliability of the new tape and said it should be treated with caution.
"It's a claim made by a man in Arabic with a Moroccan accent. He makes the statement in the name of someone claiming to be the military spokesman of al-Qaida in Europe - Abu Dujan al-Afghani."
This name was unknown to Spanish officials or to foreign intelligence services whom Spain had asked for help, Acebes said.
Coming just before polling stations open for the general election, the tape itself was not released.
But some parts of a transcript were released by the ministry.
"This is an answer to your cooperation with the Bush criminals
and their allies.
"This is an answer to crimes which you committed in
the world, notably in Iraq and Afghanistan, and there will be more, so help us God."
The claim of responsibility comes days after 10 bombs exploded on four trains in the Madrid area, killing 200 people and injuring 1500.
Even before voting booths opened, thousands of demonstrators flocked into the streets of Madrid and other cities to protest against the government's response to Thursday's bombings.
Some protesters accused Prime Minister Jose Maria Aznar of provoking the attacks by supporting the US in its invasion of Iraq.
More than 3000 demonstrators shouted slogans such as "Resign" and "Kick Aznar Out!" beside the Atocha station, where two of the four trains exploded.
However, Aznar's hand-picked candidate, Mariano Rajoy, charged that protests were illegal because of a ban on political demonstrations on the eve of an election.
But thousands ignored his comments, and more than 8000 demonstrators gathered in the Basque city of Bilbao to condemn an attack which the government had initially blamed on violent Basque separatists from ETA.
Deputy PM Mariano Rajoy (L)
has Aznar's complete backing
No one is sure how the Thursday bombings will affect elections, which pit the ruling centre-right Popular party against the main opposition Socialists and a host of smaller parties.
Popular party legacy
The Spanish prime minister, once ridiculed as a colourless technocrat, has achieved unrivalled political stature in Spain, but has decided not to seek a third term.
Internationally, the PM is likely to be best remembered for his unwavering support of US President George Bush in the run-up to the war in Iraq.
Aznar's support came despite a public outcry and mass street demonstrations across Spain – taking the country to war for the first time in more that 27 years.
Domestically, he helped revitalise the economy and his government said a clampdown on the Basque separatist group ETA had driven it to the brink of collapse.
Aznar has also alienated regional political parties, who might be needed in the event that Rajoy needs a coalition to govern.
Rajoy, 48, has held four different cabinet posts plus the position of deputy prime minister.
He came up through the ranks in the northern Galician region, starting his public career as property registrar at 23 and elected mayor of the town of Alama in 1981.
Socialist candidate Jose Zapatero took over a party in tatters in July 2000.
He faces the challenge of returning the party to the glory days of former Prime Minister Felipe Gonzalez, who governed for nearly 14 years before being defeated in 1996 in the wake of corruption scandals.
Socialist prime ministerial
candidate Jose Zapatero
He has been in Congress since 1986, took the top party post after the ruling Popular party won again with an absolute majority.
Zapatero later emerged as a more feisty opposition leader by supporting a one-day general strike, criticising the government for its handling of a massive oil spill and opposing the war in Iraq.
Zapatero has pledged to bring home the 1300 troops in Iraq when their mandate ends on 30 June if he wins.