The Socialists, led by Jose Luis Rodriguez Zapatero, captured 43 percent of the vote as of late Sunday, and the 174 parliamentary seats needed for a win.
The vote appeared to be a rebuke against the ruling popular party of Spanish Prime Minister Jose Maria Aznar following terrorist attacks that killed 200 people in Madrid and wounded another 1,500.
With Islamic terrorists increasingly considered the prime suspects of the train attacks, Spaniards saw themselves as victims of Aznar´s support for the U.S.-led war on Iraq despite massive popular opposition to the conflict. Polls showed 90 percent opposition to the invasion of Iraq last year.
Officials said the electoral turnout Sunday was 63 percent for the election which ended eight years of conservative rule, the BBC reported.