This is from the BBC. Zapatero will still need to find a partner party with a few seats to have a majority. Interesting that Spain seems to be facing some of the same economic problems as the U.S. Zapatero's foreign policy is not as pro-U.S. as the Popular Party was when in power. The Socialists withdrew troops from Iraq as I recall.
Victorious Spanish PM urges unity
Spain's Prime Minister Jose Luis Rodriguez Zapatero has promised a new era in Spanish politics, after winning another four year term in office.
His Socialist Party won 169 seats, five more than in the last election, but still short of an absolute majority.
Mariano Rajoy's conservative Popular Party won 153 seats.
Mr Zapatero thanked jubilant supporters for a "clear victory" and urged unity, pledging a "new period" in Spanish politics after a bitter campaign.
"The Spanish people have spoken clearly and have decided to open a new period without tension, without confrontation," Mr Zapatero told the flag-waving crowd gathered outside his party's Madrid headquarters.
Backing for reforms
Party spokesmen said the result was a clear endorsement of the prime minister's programme of liberal reforms - including a gender-equality law, fast-track divorces and same-sex marriage - which has been fiercely opposed by conservatives and the Roman Catholic Church.
SEATS WON IN LOWER HOUSE
PSOE (Socialists): 169
PP (Popular Party): 153
CiU (Catalan): 11
PNV (Basque Nationalist): 6
ERC (Catalan leftist): 3
IU (United Left): 2
BNG (Galician Nationalist): 2
CC (Canary Isles): 2
UPyD (Progress and Democracy): 1
NA-BAI (Navarre): 1
Source: Reuters, with 99.7% of votes counted
The BBC's Steve Kingstone in Madrid says the Popular Party (PP) will now have to face up to a clear defeat. It had never really got over losing in 2004, he says, which it blamed on voter reaction to the Madrid train bombings three days before the election.
The PP had looked likely to win before the 2004 attacks. But voters rebelled at what they saw as its attempts to blame Basque separatists, ignoring evidence implicating Islamists and diverting attention from its unpopular role in the Iraq war.
Mr Rajoy, the prime minister's leading rival, had accused him during the campaign of winning in 2004 "because of Iraq and the 11 March attack".
But he said after Sunday's defeat that he had congratulated Mr Zapatero.
"I have called the candidate of the Socialist Party and I have wished him luck for the good of Spain," he said.
Turnout was recorded at 75.3%, only just below the record 75.6% last time round. It had been predicted that a high turnout would benefit the Socialists.
Both main parties increased their percentage of the vote and their number of seats compared with the 2004 election, at the expense of small leftist and regional parties.
The Socialist Party took 43.7% of the vote, and the PP 40.1%.
Pio Garcia Escudero, the PP's campaign co-ordinator, took consolation in the party's improved performance.
"The number of votes we have won has risen considerably from 2004, as has the number of seats," which was up from 148 last time, he said. "That gives us enormous satisfaction."
Although the Socialist Party has increased its number of seats, correspondents say it will still have to go into an informal coalition, probably with the largest Catalan nationalist party.
The elections were marred by Friday's killing of the former socialist councillor, Isaias Carrasco, in the Basque country.
Police have blamed Basque separatists for the shooting, which brought election campaigning to an early close, but so far no group has claimed responsibility.
But security has been less of an issue in this election than the economy.
After a decade of growth, Spain is stuttering. Inflation is at a 10-year high and unemployment is the highest this century.
The Spanish housing boom is dwindling, exacerbated by the global credit crunch.
Mr Zapatero is expected to start his new term by announcing measures to boost growth and jobs.
Spain's 35 million voters were electing 350 members of the Cortes, or lower house of parliament, and 208 members of the 264-member upper house, the Senate.
The Socialists gained eight seats in the Senate - taking them to 89 - and the PP lost one - giving it 101.
The remaining 56 Senate seats are decided by indirect election by assemblies in Spain's 17 autonomous regions.