The Socialists took just 28 out of 109 available seats, while the main conservative popular party won 53, two short of a majority. The far-right Vox party took 15 seats, making it a potential kingmaker.
Spanish Prime Minister Pedro Sánchez's Socialists suffered a historical drubbing in a regional election in Andalusia in what could be a dress rehearsal for a national vote next year, final results showed on Monday.
The Socialists won just 28 seats in the 109-seat regional parliament, down two from four years ago, in Sunday's vote, according to results with 99.9% of ballots counted.
After resounding defeats for the left in three previous regional elections, the debacle in Andalusia will be particularly painful for Sánchez, whose candidate is his former deputy and ex-finance minister María Jesús Montero.
The defeat follows recent losses for the Socialists in Extremadura, Aragon and Castile, and Leon regions, increasing pressure on Sánchez before a general election expected in 2027.
Andalusia, a sun-soaked tourist magnet famed for its beach resorts and historic cities such as Seville and Granada, was governed by the Socialists for nearly 40 years until the conservative People's Party (PP) took power in 2019.
With a population of 9 million it is the most populous region of Spain.
One of the biggest surprises of the night was the strong showing of the left-wing regional party Adelante Andalucia, which went from two seats to eight.
The PP this time won 53 seats, but fell short of an outright majority and is expected to rely on the support of the far-right party Vox to govern.
The result marked a partial disappointment for Andalusian president Juan Manuel Moreno, whose PP party lost five seats compared with the previous regional election in 2022.
Vox came third with 15 seats, one more than previously, strengthening its leverage in negotiations with Moreno.
"Andalusians have given us a clear mandate...to continue the transformation of Andalusia," Moreno said after the result. He had relied on Vox support to govern the region since 2019.
The PP has formed coalition governments in Aragon and Extremadura and is in talks to do so in Castile and Leon.,
The PP has not ruled out cooperation with Vox at the national level if the general election produces no clear parliamentary majority.