A far-right party on Sunday won seats in a Spanish regional parliament for the first time since the country returned to democracy following the death of longtime dictator Francisco Franco in 1975, results in Andalusia's election showed.

With 93 percent of the votes counted, the small Vox party took 12 seats, handing a majority to right-wing parties in the southern Spanish region governed by the Socialists for the last 36 years.

The result means that Vox, which opposes illegal immigration and Catalan independence, has exceeded even the most optimistic poll predictions which had forecast a possible five seat win.

The Socialist Workers' Party (PSOE) scored the worst result in its history winning 33 seats so far.

Its potential ally on the left Adelante Andalusia (Forward Andalusia) picked up only 17 seats, depriving the left of a majority, while the conservative Popular Party (PP) won 26 seats and the Ciudadanos liberals took 21 seats.

The poll had been seen as the first of a series of tests for Socialist Prime Minister Pedro Sanchez.

It was Sanchez's first electoral test since taking office in June after winning a surprise vote of no-confidence in parliament against the previous PP government of Mariano Rajoy over a corruption scandal.

His Socialists had ruled Andalusia since 1982.

The vote, however, is a mere foretaste of the coming 'super election year': 2019 will see municipal, regional and European elections and perhaps even an early general election to coincide with the other May polls.

All eyes will now be on Vox which can try to use Andalusia as a springboard in next year's elections.

If it did win a seat in the next general election, it would be the first time a far-right party had had a presence in Spain's lower house of parliament since 1982.

In all, 6.5 million were eligible to vote in the ballot in Andalusia, the country's most populous region and among its poorest.

The PSOE's Susana Diaz -- who last year unsuccessfully challenged Sanchez for the party leadership -- had been seeking to retain the regional presidency while also giving Sanchez and the national party a fillip.

But Vox sought to throw a spoke in their wheels by adding its voice to traditional conservative forces led by the PP and market-friendly Ciudadanos, which has in recent years challenged the PP for the mantle of Spain's dominant liberal force.

"These elections are key as a first step in the removal of Pedro Sanchez" and the PSOE from the government, PP leader Pablo Casado told Radio COPE on Friday.

Casado said a defeat in its traditional southern fiefdom would render the PSOE's attempt to retain power nationally "unsustainable." The Socialists are already walking a tightrope given they hold just 84 seats in the 350-seat national assembly.

Both the PP and Ciudadanos had said during the campaign that if rightwing forces together won a majority of seats they would not rule out accepting support in the regional chamber from Vox.

Vox's campaigning had mainly been against illegal immigration and any decentralisation of powers from Madrid.

"Vox is going to back whichever option entails throwing out Susana Diaz and the Socialist Party" from the regional administration, party deputy-leader Javier Ortega Smith said Saturday.

Diaz meanwhile called for "stability" as she ended her campaign, warning voters against forces of the right and far-right that "want to take us backwards".

Turnout by 1700 GMT was 46.4 percent, the regional government said -- five points down on the last election in 2015. </s> A far-right party has won seats in a Spanish regional parliament for the first time since the country returned to democracy following the death of longtime dictator Francisco Franco in 1975.

With 99% of the votes counted in Andalucía, the small Vox party took 12 seats in the 109-member regional parliament.

The Socialists won the election, but saw their support plummet to just 33 seats, compared to 47 in 2015 – far from the majority of 55 seats needed to govern.

The result means that Vox, which opposes illegal immigration and Catalan independence, has exceeded even the most optimistic poll predictions which had forecast a possible five seat win. The party’s platform includes restricting abortion and rolling back domestic violence laws.

Vox had not previously held any seats in any legislative body in Spain since its founding four years ago, and now it has the key to forming a government in the nation’s most populated region.

“Now is the moment to say loud and clear who we are and that we have come to stay,” Vox candidate Francisco Serrano told a crowd of supporters who chanted: “Spain! Spain! Spain!”

Andalucía has been a Socialist bastion for 36 years, but the party could lose control of the government if parties on the right join forces to oust regional leader Susana Diaz, though that would require that they join forces with Vox.

“Despite winning the election it is a sad night for the Socialist Party,” Diaz said.

“There has been a real loss of ground for the Left. But the worst thing is that the extreme right, a phenomenon that has appeared in the rest of Europe, has arrived here.”

Diaz said she would call on other parties to “build a firewall against the extreme right in Spain.”

“Each party must decide if they are against the extreme right or if they will rely on their support to enter into government,” she said.

The Socialist Workers’ Party (PSOE) scored the worst result in its history winning 33 seats so far.

Its potential ally on the left Adelante Andalusia (Forward Andalusia) picked up only 17 seats, depriving the left of a majority, while the conservative Popular Party (PP) won 26 seats and the Ciudadanos liberals took 21 seats.

The poll had been seen as the first of a series of tests for Socialist prime minister Pedro Sanchez.

It was Sanchez’s first electoral test since taking office in June after winning a surprise vote of no-confidence in parliament against the previous PP government of Mariano Rajoy over a corruption scandal.

His Socialists had ruled Andalusia since 1982.

The vote is a mere foretaste of the coming “super election year”: 2019 will see municipal, regional and European elections and perhaps even an early general election to coincide with the other May polls.

All eyes will now be on Vox, which could try to use Andalusia as a springboard in next year’s elections.

Associated Press and Agence France-Presse contributed to this report </s> In this Sunday, Dec. 2, 2018 photo, Spain's far-right Vox Party President Santiago Abascal, centre, with the general secretary, Javier Ortega, left, and regional candidate Francisco Serrano take part in a rally during regional elections in Andalusia, in Seville, Spain. The Socialists won just 33 seats in the Andalusia legislature, compared to 47 in 2015. The party could lose control of Spain's most populated region for the first time in 36 years if parties on the right can agree to form a government. The anti-immigrant, extreme right Vox party won 12 seats - its first in any Spanish legislative body. (AP Photo/Gogo Lobato) (AP)
The Socialist and current regional President Susana Díaz wins the election, but loses 14 seats.