efe-epaBy Julia R. Arevalo Madrid

Spanish Prime Minister Pedro Sanchez's Socialist Party emerged from Sunday's snap elections as virtually certain to stay in power, although to do so he will need the support of at least one other party.

The Socialist Party (PSOE) obtained 28.68 percent of the vote, and 123 of the 350 lower-house seats, according to official results with 99.99 percent of the votes counted.

The conservative Popular Party (PP) came in second, with 16.7 percent and 66 seats, followed by Ciudadanos (Citizens, center-right) with 15.86 percent, garnering 57 seats, and leftist Unidas Podemos (United We Can) getting 35 seats with 14.31 percent of the vote.

Vox – the first far-right party to enter the National Parliament since Spain's transition to democracy after military dictator Francisco Franco's death in 1975 – obtained 10.26 per cent of the votes and 24 seats.

The leader of Vox, Santiago Abascal, was the first party leader to appear before his supporters, who welcomed him on Madrid's Margaret Thatcher Square with shouts of "Spain, united, will never be defeated!"

Vox has a heavy emphasis on anti-Catalan separatism, which is one of the central pillars of a party whose meteoric rise came just after the illegal – and ultimately abortive – referendum on the prosperous northeastern region of Catalonia's independence back in 2017.

Abascal promised to provided "resistance" with his 24 lawmakers "in the face of the break-up (of Spain) and against freedom-destroying positions" and he boasted of having garnered 2.5 million votes for a party that, in earlier elections, had only managed to scrape together some 40,000 supporters at the polls.

The "ultra-rightist" leader, who formerly belonged to the PP, warned Sanchez that no majority in Parliament will enable him to reform the Constitution or approve "totalitarian legislation on the part of the 'progressive' dictatorship."

Having increased his party's parliamentary weight from 84 to 123 seats in the lower chamber, Sanchez can now choose between an alliance, or a coalition government, with either the Ciudadanos party or with Unidas Podemos plus one or more regional parties.

The leader of Unidas Podemos, Pablo Iglesias, congratulated Sanchez and said that the results were hopeful since "the parliamentary weight of the progressive bloc exceeds that of the bloc of the three rightist" parties in the country.

"Pedro Sanchez, who has won the elections, at this time must avoid the orange temptation (orange being the identifying color of Ciudadanos and its leader, Albert Rivera) because it's time to shield public services," Iglesias said.

The leftist leader demanded that Sanchez halt the right in Spain and build a coalition government of left-leaning politicians.

"Not with Rivera, not with Rivera," Socialist activists and supporters chanted when their leader, dressed casually in jeans and with his shirtsleeves rolled up, emerged on the balcony of the PSOE headquarters on Madrid's Ferraz Street, which was jammed with people celebrating the election result.

"From our progressive position, we're going to extend our hand to all political groups within the Constitution," the premier said, while his supporters insisted on demanding that he steer clear of a coalition pact with Ciudadanos.

Sunday's vote was the third general election in less than three-and-a-half years in the Mediterranean country.

On June 1, 2018, Sanchez became the first Spanish prime minister to assume office via a no-confidence motion, which he successfully tabled against his PP predecessor, Mariano Rajoy.

Last February, he called the snap elections held on Sunday after Catalan separatists linked up with right-wing opposition parties to reject his government's budget for 2019.

The Socialist Party had not emerged as the top vote-getter in any of Spain's general elections since 2008.

In Sunday's vote, however, the party managed to achieve an absolute majority of 122 senators in the 266-seat Senate.

For the PP conservatives, meanwhile, this was the worst result in the history of their party.

Rivera and PP leader Pablo Casado publicly appeared at the same time as Sanchez was celebrating his victory with his Socialist backers after midnight in Madrid.

Rivera said that the PSOE will govern with the leftists of Iglesias and with the nationalist parties, and Casado demanded that the premier come to a governing agreement "without needing the independence-minded" forces.

Turnout was estimated at 75.75 percent of the country's registered voters, the highest since the 1996 elections.