Sebastien Loeb has taken his ninth Rally Spain victory in a dramatic ending to the penultimate 2018 World Rally Championship event.

The nine-time world champion took the lead on Sunday morning after Jari-Matti Latvala suffered his second puncture of the weekend and dropped to sixth.

Loeb appeared to have a problem that caused his C3 to understeer in the final stage of the rally but still held on to finish 2.9 seconds ahead of Sebastien Ogier.

Loeb’s first WRC win since 2012, which was his last full season in the series, comes on his third and final outing of 2018, and is Citroen’s first win of the season.

Ogier’s second allowed him to overhaul Thierry Neuville in the title battle and he will start Rally Australia with a three-point lead over his rival.

Neuville was set to finish third before a puncture and broken wheel rim in the powerstage dropped him down to fourth.

This left Elfyn Evans to take the final podium spot.

Dani Sordo took fifth on one of his favourite rallies, showing good pace and briefly holding the lead on Saturday afternoon after early pacesetter Ott Tanak suffered a puncture.

Tanak held a commanding lead of over half a minute on Saturday morning but dropped down to ninth after clipping his front left tyre and being forced to stop and change the puncture.

Despite still showing decent pace Tanak could only climb back to seventh,  and although he comes away with the full five powerstage points available he now sits 23 points behind championship leader Ogier.

The Toyota duo of Tanak and Latvala had chosen to use the full wet tyres on the rainy Saturday morning stages, a gamble which rocketed them up timings.

Latvala had been sitting in second place before a puncture on Friday dropped him down the field and the correct tyre choice allowed him to pass Sordo for the lead after Tanak’s misfortunes.

The Finn held the position and looked set to take his first win since Sweden last year before he suffered his second puncture of the event, dropping him to sixth.

In the powerstage he slowed to allow team-mates Tanak and Esapekka Lappi up into sixth and seventh.

Lappi had a difficult rally, struggling with first the brakes and then the tyres in the wet conditions so rarely encountered on the WRC calendar.

Craig Breen and Andreas Mikkelsen completed the top 10 finishers, with Kalle Rovanpera taking WRC2 victory ahead of newly-crowned champion Jan Kopecky.