The United States is bracing for possible terrorist attacks before the November presidential election, national security adviser Condoleezza Rice (search) said Sunday.  

The opportunity for terrorists to try to influence the election, as was the case last month in Spain, appears to be an opportunity that would "be too good to pass up for them," Rice said.

"I think that we do have to take very seriously the thought that the terrorists might have learned, we hope, the wrong lesson from Spain," Rice told "Fox News Sunday."

"I think we also have to take seriously that they might try during the cycle leading up to the election to do something," she said.

"We are actively looking at that possibility, actively trying to see — to make certain that we are responding appropriately," she said.

Jose Maria Aznar (search), outgoing prime minister of Spain and a strong U.S. ally in the war in Iraq, says he has warned President Bush that he believes terrorists will try to affect the U.S. election as they did in Spain.

On March 11, terrorists blew up a rail line in Madrid, killing 191 and injuring 1,800 others.

"I told George Bush, and [British Prime Minister] Tony Blair (search) and other political leaders to be extremely careful before elections ... and to be very vigilant," Aznar told Fox.

Aznar's Popular Party was favored to win the election until the four commuter trains were attacked. "It is obvious that these attacks were looking for a political effect," he said.

Socialist leader Jose Luis Rodriguez Zapatero (search), who succeeded Aznar, announced on Sunday that he was ordering Spanish troops out of Iraq "in the shortest time possible."

Earlier, Zapatero said he would pull the 1,300 Spanish troops by June 30 unless the United Nations took over political and military control of the occupation. He said he acted after deciding that the United Nations was not prepared to take over the occupation.

Foreign Minister Miguel Angel Moratinos said he would meet Wednesday in Washington with Rice and Secretary of State Colin Powell (search).

Newspaper reports from Spain said Moratinos hopes to show U.S. officials that Spain wants to maintain its current good relations with the United States and that the minister will offer nonmilitary cooperation in Iraq, such as training of police, as an alternative to having Spanish soldiers in the country.