Anti-austerity Podemos and liberal Ciudadanos made big gains as the conservative Popular Party (PP) lost its majority.
“Spain is not going to be the same anymore and we are very happy,” said Podemos leader Pablo Iglesias.
The PP and the Socialists had alternated running the government for more than three decades.
The parties must now embark on negotiations to form a coalition.
The PP had 28.72% of the vote, the Socialists 22.01%, Podemos 20.66% and Ciudadanos 13.93%.
PP leader Mariano Rajoy said he would try form a government, insisting: “This party is still the number one force in Spain.”
However, Mariano Rajoy admitted that his party had taken some “difficult and even unpopular decisions” over the past four years as Spain struggled through an economic crisis.
Socialist leader Pedro Sanchez said his party was ready to start negotiations.
“Spain wants a move to the left,” he said.
Many Spaniards are poorer now than they were at the time of the last election, fuelling the rise of Podemos.
Spain’s unemployment remains high at 21%, the second-highest rate in the EU after Greece, although it has fallen from its 2013 peak of 27%.
The economy, corruption allegations and a separatist drive in the prosperous north-eastern region of Catalonia were all dominant issues in the election.
Podemos claimed it won more votes than any other party in Catalonia and the Basque region and came second in Madrid.
“Many people have lost their confidence in traditional parties,” said deputy leader Inigo Errejon.
“The two-party system has ended.”
Podemos’s rise was also hailed by Greek PM Alexis Tspiras, whose Syriza party is its ally.
“Austerity has been politically defeated in Spain,” said Alexis Tsipras, adding that the result was a sign that “Europe is changing”.
Albert Rivera, leader of the fourth-placed party Ciudadanos, meanwhile said the election marked a new era for young Spaniards like him, who were born after the country’s dictatorship ended in 1975.
“Those of us who didn’t experience the first democratic transition are experiencing a second one,” he said.
Election turnout was 73.2% – up slightly compared to the 2011 election.
In line with Spain’s constitution, after talking to each party, King Felipe VI will nominate a candidate for prime minister. This cannot take place until after the new Congress holds its inaugural meeting on January 13.
The nominee must then win a vote of confidence in parliament. If this fails, another candidate can be nominated and seek parliamentary approval.
If no administration can be formed within two months of the election, another must be held.
The US House Ethics Committee has voted to release its report on former Republican Representative…
ABC News has agreed to pay $15 million to President-elect Donald Trump to settle a…
South Korea’s parliament has voted to impeach President Yoon Suk Yeol over his failed attempt…
Israeli war planes have carried out more than 100 air strikes in Syria on December…
President-elect Donald Trump has threatened to impose 100% tariffs on the BRICS countries if they…
Syrian troops have withdrawn from the city of Aleppo following an offensive by rebels opposed…