Formula E frontrunner Lucas di Grassi thought his race was over on three occasions before claiming a shock victory in the Mexico City ePrix.
A strategy gamble propelled the Abt Audi Sport driver from last, after pitting with a broken rear wing on the third lap, to his first win of the 2016/17 season.
Di Grassi told Autosport he felt "there were three occasions where I thought, 'That's over'".
His first pitstop was rescued by a safety car, while his early move to swap cars under a second caution period - seven laps before anyone else - would have been more successful had the safety car stayed on track longer than just one more lap.
Di Grassi said the final safety car, which obliterated the 30-second lead he held over cars with significantly more energy left, was his most concerning moment.
"The rear wing, there was nothing I could do," he said.
"Then there was a safety car, so I went back to last, and then we did a very smart move on strategy again.
"You can only do that move on strategy if you have very energy efficient car/driver combination.
"If the third safety car didn't come up I thought I could manage the gap to Jean-Eric Vergne but when it came I realised it would be extremely tough."
After swapping cars so much earlier than the rest of the field, di Grassi had around a third less energy than the frontrunners when the rest of the stops had been completed by lap 25 of 45.
Di Grassi admitted the catalyst for his victory was Jerome d'Ambrosio, who adopted the same strategy as the Brazilian and held up Vergne and the rest of the chasing pack.
"He did a fantastic job holding them up, that helped massively to win the race," said di Grassi.
"With the difference in energy we had I thought it would be very difficult or almost impossible."
It was the second time this season di Grassi and Abt have rescued a result after an early stop to replace a broken wing, having finished second in Hong Kong with a similar strategy.
The early shunt in Mexico that broke di Grassi's rear wing was a legacy of his poor qualifying performance, which left him starting 15th and in the middle of a concertina at the Turn 3 chicane.
Di Grassi's shock turnaround in the race brought him to just four points from championship leader Sebastien Buemi, who failed to score after spinning shortly after the car swaps.
"I was in heaven, second in FP2 and a few hundredths off, then I went through hell in qualifying and starting at the back," said di Grassi.
"Then it was back to heaven and hell and heaven and hell in the face, and finally finishing in heaven."