None of the opinion polls had predicted the historic regional election result in Andalucía last Sunday night. A sharp decline in support for the ruling PSOE Socialist party and a drop-off in votes for the left in general gave parties to the right a majority and the chance to wrest control of the Junta de Andalucía regional government from the PSOE for the first time in 36 years.
With almost 28 per cent of the vote, Susana Díaz's Socialists are still the largest party but, with just 33 seats in the 109 regional parliament, they are a long way from an overall majority in Andalucía, seen as a traditional bastion of PSOE power.
The other main news of the night was the shock emergence of far-right party, Vox, as a parliamentary force, winning 12 seats, its first in any part of Spain, with 11 per cent of the vote. Observers said that it was the country catching up with an international trend in populism, although large demonstrations have been held against the party's policies in cities across the region this week.
Not even Adelante Andalucía, the left-wing alliance of Izquierda Unida and Podemos, could offer its support to the PSOE and keep Susana Díaz as president of the Junta de Andalucía government. Teresa Rodríguez's group lost three seats, down to 17 with 16% of votes.
Centre-right party, Ciudadanos (Cs), under Juan Marín, more than doubled its seats to 21, with 18 per cent of the vote, and was seen as the success story of the night, close to PP and a rival to lead the Junta.
Although the conservative Partido Popular (PP), under Juanma Moreno, lost ground, finishing on 26 seats and 20.7 per cent, its second place position immediately gave the party hope that it could lead a coalition of the right to take power from the PSOE in the region after four decades.
Party backs Díaz for now
Susana Díaz's future was still unclear this week, although after hesitation, her national party backed her. Díaz had called the early election after Ciudadanos withdrew its support for her minority control of the Junta de Andalucía government, which controls big-spending services such as health, education and social care. Until Sunday's result, polls had shown that she was on course to probably form a government again.
The total of MPs for the PP (26), C's (21) and Vox (12) is 59 and a sufficient majority to keep out the PSOE. But a pact needs to be negotiated ahead of a parliamentary investiture debate due by the end of December.
The second most-voted group was the conservative Partido Popular, which has lost seven seats, but, with the support of the other right-wing groups, could take the region away from the Socialists for the first time ever.
Centre-right Ciudadanos increased its representation by 12 seats to a total of 21.
Far-right newcomers Vox gain representation in the Andalusian parliament for the first time with a surprise result of 12.
The left-wing group Adelante Andalucía (uniting Podemos and Izquierda Unida, among others) won 17 seats, which, combined with the PSOE's 33, fail to reach the 55 seats needed for an overall majority.
The turnout was 58%, significantly lower than in 2015.
Malaga reflects regional trend
The results in Malaga threw up a three-party tie. The province, which includes the western and eastern Costa del Sol, the city and inland areas, has a total of 17 seats in the regional parliament. On Sunday Malaga voters gave the three parties PSOE, PP and C's four seats each, with three going to Adelante Andalucía and a surprise two to far-right Vox.
As in the region as a whole the Socialists won the most votes (24.2%), followed closely by the PP (22.6%) and C's (19.8%). The left-wing alliance Adelante Andalucía gained 15.6% and Vox 11.5%.
The PSOE won the most votes in 69 of the 103 municipalities in Malaga province (down from 82 in 2015), although the PP won the election in the main Costa towns, with the exception of Marbella, where the PSOE won 500 votes more than the PP, and Malaga city where the Socialists gained the most votes, followed by Ciudadanos, relegating the PP to third place. Ciudadanos won more votes than any other party in four towns, Rincón, Alhaurín de la Torre, Manilva and Benalmádena.
Far-right newcomers Vox gained 72,455 votes in the province of Malaga, their best result in percentage terms being in Benahavís, with nearly 20% of the total number of votes.