America's allies must stick together in the "war on terrorism", US President George W Bush has said.
The Spanish election has dented Mr Bush's "coalition of the willing"
He urged nations to keep their forces in Iraq, following a threat by the new Spanish prime minister to withdraw his country's troops.
They were his first detailed comments since the devastating train bombs in Madrid last Thursday.
Meanwhile, Spanish police are reported to have identified six Moroccan men they believe were behind the attacks.
The El Pais newspaper quoted security sources as saying that five were still at large but one - Jamal Zougam - was in custody.
Mr Zougam was arrested on Saturday with two other Moroccans and two Indians.
Tuesday evening saw several thousand people, including the queen of Spain, gather in Madrid's largest cathedral for a memorial service to remember the 201 people killed by last week's bombings.
European leaders are calling for a co-ordinated policy to prevent similar attacks in the future.
At a meeting in Paris, French President Jacques Chirac and German Chancellor Gerhard Schroeder called for improved co-operation between intelligence services and an EU-wide plan of action.
Police in London have warned that a major attack there is inevitable, but are urging people to go about their lives normally.
'Side-by-side with Iraqi people'
Mr Bush said the goal of the "cold-blooded killers" who carried out attacks like the Madrid bombings was "to try to get the world to cower... to try to shake our will".
He added: "It is essential that the free world remain strong and resolute and determined."
He was speaking after a meeting in Washington with Dutch Prime Minister Jan Peter Balkenende - whose country has itself deployed troops in Iraq, against significant public opposition.
The bomb attacks have prompted concern throughout Europe
The Netherlands and Denmark have both said they will keep their troops in Iraq, despite the incoming Spanish prime minister's announcement.
One of the first post-election statements of Jose Luis Rodriguez Zapatero was a pledge to pull Spain's 1,300 troops out of Iraq unless the United Nations took command of the operation.
"It is essential that we remain side-by-side with the Iraqi people," said Mr Bush.
"Al-Qaeda understands the stakes. Al-Qaeda wants us out of Iraq because al-Qaeda wants to use Iraq as an example of defeating freedom and democracy."
Mr Bush did not refer to elections in Spain on Sunday, which saw a surprise victory for the socialists amid public anger at the government's handling of Thursday's bombs and its participation in the Iraq invasion.
However, the BBC's Washington correspondent Rob Watson says there is no doubt the Bush administration has been stung by the results.
US administration officials say President Bush has already called several world leaders to insist they remain on the offensive in the war against terrorism.
And White House spokesman Scott McClellan cautioned Spaniards and others against sending a "terrible message" by letting terrorists influence their elections and policies.
In an interview with the BBC, US Defence Secretary Donald Rumsfeld that "obviously one would prefer that more countries would come in than a country leave".
But, he suggested, Spain's pledge could prompt other countries to "step in" and send troops.