People prepare their ballots at a polling station during the Spanish General Elections on November 10, 2019 in Madrid, Spain. Spain holds its fourth general election in four years on Sunday 10th November in the hope of breaking a prolonged political deadlock.

Prime Minister Pedro Sánchez's Socialists won Spain's national election on Sunday but large gains by the upstart far-right Vox party appear certain to widen the political deadlock in the European Union's fifth-largest economy.

After a fourth national ballot in as many years and the second in less than seven months, the left-wing Socialists held on as the leading power in the National Parliament. With 99% of the votes counted, the Socialists won 120 seats, down three seats from the last election in April and still far from the absolute majority of 176 needed to form a government alone.

The big political shift came as right-wing voters flocked to Vox, which only had broken into Parliament in the spring for the first time.

The far-right party led by 43-year-old Santiago Abascal, who speaks of "reconquering" Spain in terms that echo the medieval wars between Christian and Moorish forces, rocketed from 24 to 52 seats. That will make Vox the third leading party in the Congress of Deputies and give it much more leverage in forming a government and crafting legislation.

The party has vowed to be much tougher on both Catalan separatists and migrants.

Abascal called his party's success "the greatest political feat seen in Spain."

"Just 11 months ago, we weren't even in any regional legislature in Spain. Today we are the third-largest party in Spain and the party that has grown the most in votes and seats," said Abascal, who promised to battle the "progressive dictatorship."

Right-wing populist and anti-migrant leaders across Europe celebrated Vox's strong showing.

Marine Le Pen, who heads France's National Rally party, congratulated Abascal, saying it was impressive how his work "is already bearing fruit after only a few years."

In Italy, Matteo Salvini of the right-wing League party tweeted a picture of himself next to Abascal with the text "Congratulations to Vox!" above Spanish and Italian flags. And in the Netherlands, anti-Islam Dutch lawmaker Geert Wilders also posted a picture of himself and Abascal and wrote "FELICIDADES" — Spanish for congratulations — with three thumbs-up emojis.

Sunday's results means there will be no end to the stalemate between forces on the right and the left in Spain, suggesting the country could go many more weeks or even months without a new government.

The mainstream conservative Popular Party rebounded from their previous debacle in the April vote to 87 seats from 66, a historic low. The far-left United We Can, which had a chance to help the Socialists form a left-wing government over the summer but rejected the offer, lost some ground to get 35 seats.

The undisputed loser of the night was the center-right Citizens party, which collapsed to 10 seats from 57 in April after its leader Albert Rivera refused to help the Socialists form a government and tried to copy some of Vox's hard-line positions.

Sánchez's chances of staying in power will still hinge on finally winning over the United We Can party and several regional parties, a complicated maneuver that he has failed to pull off over the past few months.

"These elections have only served for the right to grow stronger and for Spain to have one of the strongest far-right parties in Europe," said United We Can leader Pablo Iglesias. "The only way to stop the far-right in Spain is to have a stable government. We again extend our hand to Pedro Sánchez."

Vox has already joined forces with the Popular Party and Citizens to take over many city and regional governments in the past year. Those three groups would readily band together to oust Sánchez, who is seen by the right-wing opposition as too soft on the Catalan secessionist movement.

Julia Giobelina, a 34-year-old web designer from Madrid, was angry at having to vote for the second time this year but said she cast her ballot in hopes of stopping the rise of Vox.

"They are the new fascism," Giobelina said. "We citizens need to stand against privatization of health care and other public services."