Spanish Prime Minister and Spanish Socialist Party (PSOE) candidate for prime minister Pedro Sanchez casts his ballot next to his wife Begona Gomez at a polling station in Madrid during general elections in Spain on April 28, 2019. - Spain returned to the polls for unpredictable snap elections marked by the resurgence of the far-right after more than four decades on the outer margins of politics. (Photo by JAVIER SORIANO / AFP)        (Photo credit should read JAVIER SORIANO/AFP/Getty Images)
JAVIER SORIANO/AFP/Getty Images
Spanish Prime Minister and Spanish Socialist Party (PSOE) candidate for prime minister Pedro Sanchez casts his ballot next to his wife Begona Gomez at a polling station in Madrid during general elections in Spain on April 28, 2019. - Spain returned to the polls for unpredictable snap elections marked by the resurgence of the far-right after more than four decades on the outer margins of politics. (Photo by JAVIER SORIANO / AFP) (Photo credit should read JAVIER SORIANO/AFP/Getty Images)
Now playing
03:20
Spain's socialist party wins general election
ITN
Now playing
01:15
Prince Charles speaks following Prince Philip's death
LONDON, UNITED KINGDOM - APRIL 10: The Honourable Artillery Company fire a gun salute at The Tower of London on April 10, 2021 in London, United Kingdom.  The Death Gun Salute will be fired at 1200 marking the death of His Royal Highness, The Prince Philip, Duke of Edinburgh. Across the country and the globe saluting batteries will fire 41 rounds, 1 round at the start of each minute, for 40 minutes. Gun salutes are customarily fired, both on land and at sea, as a sign of respect or welcome. The Chief of the Defence Staff, General Sir Nicholas Carter, said "His Royal Highness has been a great friend, inspiration and role model for the Armed Forces and he will be sorely missed." (Photo by Chris Jackson/Getty Images)
Chris Jackson/Getty Images
LONDON, UNITED KINGDOM - APRIL 10: The Honourable Artillery Company fire a gun salute at The Tower of London on April 10, 2021 in London, United Kingdom. The Death Gun Salute will be fired at 1200 marking the death of His Royal Highness, The Prince Philip, Duke of Edinburgh. Across the country and the globe saluting batteries will fire 41 rounds, 1 round at the start of each minute, for 40 minutes. Gun salutes are customarily fired, both on land and at sea, as a sign of respect or welcome. The Chief of the Defence Staff, General Sir Nicholas Carter, said "His Royal Highness has been a great friend, inspiration and role model for the Armed Forces and he will be sorely missed." (Photo by Chris Jackson/Getty Images)
Now playing
02:03
Prince Philip tributes pour in from around the world
CNN Weather
Now playing
01:35
Powerful Tropical Cyclone Seroja takes aim at Western Australia
Ash rises into the air as La Soufriere volcano erupts on the eastern Caribbean island of St. Vincent, seen from Chateaubelair, Friday, April 9, 2021. (AP Photo/Orvil Samuel)
Orvil Samuel/AP
Ash rises into the air as La Soufriere volcano erupts on the eastern Caribbean island of St. Vincent, seen from Chateaubelair, Friday, April 9, 2021. (AP Photo/Orvil Samuel)
Now playing
00:58
See the looming clouds of ash over La Soufrière volcano
People view flowers left in front of the gate at Buckingham Palace in London, after the announcement of the death of Britain's Prince Philip, Friday, April 9, 2021. Buckingham Palace officials say Prince Philip, the husband of Queen Elizabeth II, has died. He was 99. Philip spent a month in hospital earlier this year before being released on March 16 to return to Windsor Castle.
Matt Dunham/AP
People view flowers left in front of the gate at Buckingham Palace in London, after the announcement of the death of Britain's Prince Philip, Friday, April 9, 2021. Buckingham Palace officials say Prince Philip, the husband of Queen Elizabeth II, has died. He was 99. Philip spent a month in hospital earlier this year before being released on March 16 to return to Windsor Castle.
Now playing
01:54
Tributes to Prince Philip pour in from around the world
Britain's Prince Philip, Duke of Edinburgh, in his role as Captain General, Royal Marines, attends a Parade to mark the finale of the 1664 Global Challenge on the Buckingham Palace Forecourt in central London on August 2, 2017.  
After a lifetime of public service by the side of his wife Queen Elizabeth II, Prince Philip finally retires on August 2, 2017,at the age of 96. The Duke of Edinburgh attended a parade of Royal Marines at Buckingham Palace, the last of 22,219 solo public engagements since she ascended to the throne in 1952.
 / AFP PHOTO / POOL / HANNAH MCKAY        (Photo credit should read HANNAH MCKAY/AFP/Getty Images)
HANNAH MCKAY/AFP/Getty Images
Britain's Prince Philip, Duke of Edinburgh, in his role as Captain General, Royal Marines, attends a Parade to mark the finale of the 1664 Global Challenge on the Buckingham Palace Forecourt in central London on August 2, 2017. After a lifetime of public service by the side of his wife Queen Elizabeth II, Prince Philip finally retires on August 2, 2017,at the age of 96. The Duke of Edinburgh attended a parade of Royal Marines at Buckingham Palace, the last of 22,219 solo public engagements since she ascended to the throne in 1952. / AFP PHOTO / POOL / HANNAH MCKAY (Photo credit should read HANNAH MCKAY/AFP/Getty Images)
Now playing
01:39
The life of Prince Philip, Duke of Edinburgh
screengrab myanmar ambassador to UK
CNN
screengrab myanmar ambassador to UK
Now playing
01:02
Video shows Myanmar's ambassador 'locked out' of embassy
King Abdullah II of Jordan and his half brother, former crown prince Hamzah bin Al Hussein
AFP/Getty Images
King Abdullah II of Jordan and his half brother, former crown prince Hamzah bin Al Hussein
Now playing
02:39
Jordan's King breaks silence about family fallout
CNN
Now playing
06:13
Inside Iraq's crippling crystal meth crisis
Now playing
05:27
Myanmar special envoy: It is time for the world to stop another genocide
Navalny tea
Life.RU
Navalny tea
Now playing
02:44
Videos show Putin critic inside prison
Norwegian Coastal Administration
Now playing
00:34
Video shows dramatic crew rescue after ship lost power during storm
This picture shows the interior of Palais Vivienne apartment, owned by French collector Pierre-Jean Chalencon, on April 5, 2021. - The lawyer of Pierre-Jean Chalencon, owner of the "Palais Vivienne", implicated by a report from French channel M6 for clandestine dinners in Paris, told AFP on April 4th that his client was only "joking" when he declared ministers participated in such meals. Paris prosecutor Remy Heitz opened a criminal investigation on alleged dinners banned during the pandemic. - RESTRICTED TO EDITORIAL USE (Photo by Thomas COEX / AFP) / RESTRICTED TO EDITORIAL USE (Photo by THOMAS COEX/AFP via Getty Images)
Thomas Coex/AFP/Getty Images
This picture shows the interior of Palais Vivienne apartment, owned by French collector Pierre-Jean Chalencon, on April 5, 2021. - The lawyer of Pierre-Jean Chalencon, owner of the "Palais Vivienne", implicated by a report from French channel M6 for clandestine dinners in Paris, told AFP on April 4th that his client was only "joking" when he declared ministers participated in such meals. Paris prosecutor Remy Heitz opened a criminal investigation on alleged dinners banned during the pandemic. - RESTRICTED TO EDITORIAL USE (Photo by Thomas COEX / AFP) / RESTRICTED TO EDITORIAL USE (Photo by THOMAS COEX/AFP via Getty Images)
Now playing
00:38
Video shows Paris elite enjoying secret dinner parties amid pandemic
Shutterstock
Now playing
02:54
A timeline of the Iran nuclear deal so far
Houthi handout
Now playing
04:23
Yemen's Houthis step up attacks on Saudi Arabia
(CNN) —  

Spain’s center-left Socialist Workers’ Party (PSOE) won Sunday’s general election, while a far-right party will enter the country’s parliament for the first time since dictator General Franco’s rule ended in 1975.

The far-right Vox party – which takes a hardline on immigration and gender rights – won 24 out of a total 350 seats, after bursting onto Spain’s political scene last year.

In an election with 75.8% turnout, the governing PSOE took 123 seats, and will now seek the support of other parties to form a government, having fallen short of an overall majority.

Spanish politics is fragmenting further, as PSOE’s traditional rivals, the conservative People’s Party (PP) won 66 seats, down from 137 in 2016’s election.

For years Spain was governed by the PP or PSOE, but Podemos, Ciudadanos and Vox have emerged in recent years, shaking up the two-party established order.

A total of 176 seats is required to control parliament, and neither the leftist nor the right-leaning bloc won the required amount. Center-right Ciudadanos won 57 seats while left-wing Unidas Podemos won 35.

With more than 98% of the vote counted the PSOE was declared winner by Spanish government spokeswoman Isabel Celaá Diéguez.

Incumbent PSOE Prime Minister Pedro Sanchez addressed supporters outside the party headquarters in Madrid after the result was confirmed.

“After 11 years a socialist party has won the general election in Spain. And so the future beats the past,” he said as the PSOE gained 38 seats more than in 2016.

“We have sent a message to Europe and to the world, that we can win over authoritarianism.”

A nun votes in Barcelona on Sunday during the third Spanish general election in four years.
Emilio Morenatti/AP
A nun votes in Barcelona on Sunday during the third Spanish general election in four years.

Sanchez to negotiate a deal

Spain is the only country in western Europe that has never been governed by a coalition government, though recent years have seen minority governments shored up by parliamentary alliances.

A new government could include the Basque Nationalist Party, known as PNV, or the Catalan separatists that forced the elections in the first place after refusing to support Sanchez’s 2019 budget in February.

Analyst Jose Torreblanca of the European Council on Foreign Relations told CNN the PSOE and Ciudadanos are the winners of the election, while the PP suffered a “complete defeat” as a “divided right wing committed suicide.”

Albert Rivera, leader of Ciudadanos, said “the bad news today is that Sanchez will govern with Podemos and the separatists … but there is a project with a future in Ciudadanos.”

Rivera promised his followers that the party will govern soon.

“Ciudadanos has risen as the hope and the future of Spain,” he added, after the party won 25 more seats than in 2016.

PP leader Pablo Casado congratulated Sanchez for his victory and said he hoped his rival “would be able to govern without the support of the Catalan separatists.”

Sanchez could agree a deal with Podemos or Ciudadanos, according to Torreblanca.

Pablo Iglesias, leader of Unidas Podemos, said the result is enough to fulfill the party’s objective of stopping the right and forming a left-wing government.

He urged Sanchez to “not succumb to the orange temptation,” a reference to a potential pact with Ciudadanos.

Shouts from the crowd interrupted Sanchez’s victory speech several times as supporters implored him not to form a coalition with the center-right party.

Far-right Vox weaker than predicted

While Vox won fewer seats than some had predicted, it is the first time that a far-right party has had such electoral success in Spain since 1982.

“We are going to have to fight harder. This is only the beginning,” said party leader Santiago Abascal at an event at Vox headquarters in Madrid. “We told you were starting a reconquest and that is what we have done. We are here to stay.”

Voter turnout was the third-highest in the history of Spanish democracy after the 1996 elections (77.38%) and the 1993 elections (76.4%), according to official figures.

Turnout was high despite this being the third election in four years as Spain battles mounting political instability.

As in several other European countries, the far-right has gained in popularity while traditional politics is fragmenting. Spain also has had to grapple with domestic issues such as the Catalan independence movement.