Even before the bombings in Madrid, White House officials were worrying that terrorists might strike the United States before the November elections.

Now, with the Socialists' surprise election victory in Spain, analysts believe the ballot box rebuke of one of President Bush's closest allies in the war in Iraq could embolden terrorists to try the same tactics in the United States to create fear and chaos.

"That's an amazing impact of a terrorist event, to change the party in power," said Jerrold Post, a former CIA profiler who directs the political psychology program at George Washington University.

"The implications of this are fairly staggering," agreed political psychologist Stanley Renshon of City University of New York. "This is the first time that a terrorist act has influenced a democratic election. This is a gigantic, loud wakeup call. There's no one they'd like to have out of office more than George W. Bush."

In political terms, the question is whether an attack would cause Americans to rally around Bush or blame him for the nation's vulnerabilities.

Bush has made the war on terrorism his trademark issue, spending tens of billions of dollars at home and abroad in the name of fighting terrorists. Polls show it's his strongest suit in his re-election battle against Democrat John Kerry (search).

Traditionally, in times of peril, Americans have supported their president. After Sept. 11, 2001, Bush soared in the polls. That standing has softened over time but still remains strong, reinforced by the fact that America has not been hit again.

"People are critical of Bush in lots of ways but they still give him pretty good grades for dealing with the war on terrorism," said pollster Andy Kohut (search).

If there were an attack, he said, "the traditional effect is a rally."

But Kohut and others say the rally effect could diminish, particularly if Americans doubted Bush's ability to protect them or thought the war on Iraq played any part. His anti-terrorism standing might be weakened by other factors, too, such as doubts about his handling of the economy, analysts say.

How the Democrats responded to a possible attack would figure in as well.

"It has been made a political issue already," said Columbia University political scientist Robert Shapiro. "It's no longer the attack out of nowhere like 9-11 was," he said. "There's a context for it that's very different."

Kerry has been probing for Bush weaknesses on the international front, accusing the president of alienating allies at a time when the United States needed them the most. Kerry claims that some foreign leaders have told him privately that they would prefer him in the White House. The administration shot back Monday that Kerry ought to name names of foreign leaders, suggesting it would mean he lied if he failed to produce.

The administration has made no attempt to hide its concern about another attack.

"We live in an age of terror, in which ruthless enemies seek to destroy not only our nation and not only to destroy all free nations but to destroy freedom as a way of life," National Security Adviser Condoleezza Rice (search) said last week. She spoke of "our worst nightmare" of attack by chemical, biological or nuclear weapons at the hands of terrorists.

Bush regularly talks about the threat in his stump speeches. In his State of the Union address, he said it was tempting to think, after more than two years, that the danger was behind Americans. "That hope is understandable, comforting and false," Bush said.

Brookings Institution political analyst Stephen Hess said issues such as terrorist attacks are troublesome for campaigns because they represent the unknown.

"Nothing bothers a politician or a strategist as much as trying to contemplate the unknown, trying to factor it in, what would happen."