The Frenchman had led team-mate Jari-Matti Latvala by 34 seconds heading into the final day, with Mikko Hirvonen's Citroen more than one minute down the road in third.
That all changed on the 21 kilometre stage 12, when Ogier suffered a slipping clutch and Latvala a suspected broken driveshaft, causing both men to surrender huge chunks of time.
Hirvonen, second fastest on the run through Silves, gained 30s on Ogier and nearly a minute on Latvala, allowing him to jump the Finn and move into second.
The abrasive 52km SS13 threatened to exacerbate both VW drivers' woes, but emergency fixes before the stage's start ultimately stemmed the damage.
Ogier, who was driving "with fingers crossed" throughout, ended up second fastest, 12s quicker than Hirvonen.
He therefore holds a 49s lead heading into the rally's final two stages.
Latvala still struggled, losing three minutes to Ogier, but he remains third thanks largely to the comfortable margin he had eked out over M-Sport Ford's Evgeny Novikov over the first two days. The pair are now separated by just over 40s.
Novikov, struggling with his own handling issues, has a comfortable gap to stablemate Nasser Al-Attiyah and Andreas Mikkelsen in the third VW.
The Fords of Dennis Kuipers and Martin Prokop are next up, with WRC2 leader Esapekka Lappi and Citroen's Khalid Al Qassimi's Citroen ninth and 10th.
Behind them a flying Mads Ostberg moved back onto the fringes of the top 10 after going fastest through SS12 and SS13.
The Norwegian had been leading until crashing out on the first day.
- Sports & Recreation
- Mikko Hirvonen