In the aftermath of Spain's general election the winning Socialist candidate for Prime Minster, José Luis Zapatero, said he will keep his campaign pledge to withdraw Spain's 1,300 soldiers from Iraq by the end of June. Voter outrage over Thursday's terrorist attacks and the government's handling of the investigation contributed to an unexpected Socialist victory over the ruling Popular Party.

Mr. Zapatero says the Spanish troops will leave Iraq by June 30 unless there is a new United Nations mandate for their presence.

Opposition to Spain's support for the Iraq war was one the key points in Mr. Zapatero's campaign. According to public opinion polls, the vast majority of Spaniards opposed their government's role in the Iraq coalition, but the polls also indicated that would not be a major factor in the election. Prime Minister Jose Maria Aznar's party was expected to win.

But that changed after Thursday's bombings in Madrid that killed more than 200 people and injured about 1,500. Many voters apparently concluded that the attacks, which are now blamed on the al-Qaida terrorist network, resulted from Spain's support for the war. Some were also angry that the government initially blamed the Basque terrorist group ETA and continued to do so even after the first hints of al-Qaida involvement became known.

Mr. Zapatero's Spanish Socialist Workers Party won just over 42 per cent of the votes cast in Sunday's election. The Socialists won 164 seats in the 350-seat parliament, just 12 short of a majority.

The ruling Popular Party, which won 38 per cent of the vote, saw its share of seats shrink from 183 to 148.

Smaller parties won the remaining 38 seats in parliament, and one or more of them is expected to join the Socialists in a coalition government.

The pre-election strength of Prime Minister Aznar's Popular Party was attributed largely to Spain's economic prosperity during his eight years in office, with declining unemployment and inflation. The Popular Party's government also managed to sharply curtail the terrorist activities of the Basque pro-independence ETA group.

About 77 per cent of Spain's more than 35 million voters cast their ballots on Sunday, including some of those who had been injured in Thursday's bombings.