Tyre choice
Loeb was lying third overnight but charged into the lead by winning final day's opening two speed tests as an inspired tyre choice reaped rewards.
Loeb threw away vital seconds with a spin in the penultimate test to allow Ogier to close in his Ford Fiesta. He held on through the final 14.50km test for his ninth Spanish win.
Right rear
The impact broke his Hyundai i20's right rear wheel and allowed Elfyn Evans, team-mate to Ogier, to snatch third and aid his colleague's title bid. Evans ended 0.5sec clear of Neuville.
Spain's Dani Sordo was a further 1.6sec behind in fifth, while early leader Ott Tänak recovered to sixth
Successful return
Meanwhile, former WRC champion Petter Solberg gave Volkswagen Motorsport a successful one-off return to the championship with a podium finish in the new Polo R5 in the support category.
The Norwegian and his co-driver Veronica Engan caused a stir with the best time on the most challenging and longest gravel stage of the rallyand finished third in the rally won by Skoda's young Kalle Rovanpera.
Fantastic result
Solberg, who had has last competed at the Rally of Catalunya in 2012, made his comeback in precisely the same place, at which he called time on his career and impressed in the VW Polo GTI R5.
"What a fantastic result after six years away. It was not an easy task with just two days of testing and totally new pace notes. Which is why I am very proud of what Veronica and I achieved here," said Solberg.