Nissan's Oliver Rowland made outstanding use of his final seconds of attack mode to snatch victory in the Mexico City Formula E race away from the Porsches of Antonio Felix da Costa and Pascal Wehrlein.
Having left his second attack mode deployment later than the other leaders, Rowland looked like he could menace the works Porsches and Andretti's Jake Dennis if he could catch them from fourth place once he took it.
A safety car for pre-race championship leader Mitch Evans running into Dennis's team-mate Nico Mueller then appeared to wreck Rowland's opportunity.
But Rowland had one minute of the extra power and all-wheel-drive left when the race went green, and he used it superbly to surge past all three cars ahead in the half-lap he had of performance advantage before his attack mode ran out.
Da Costa came back at Rowland over the remaining laps, finishing four tenths of a second behind.
Rowland dedicated the win to his performance engineer Asier Sebastien Galardi, who was rushed to hospital on Saturday morning for appendicitis surgery.
Porsche had filled the front row with Wehrlein and da Costa and controlled the first half of the race. Dennis appeared most likely to deprive the works cars of victory as he got among them during the early attack mode shuffles but ending up having to settle for fourth.
DS Penske pair Jean-Eric Vergne and Maximilian Guenther completed the top six, while Stoffel Vandoorne salvaged what looked like it would be a poor day by using a late attack mode to rise to seventh for Maserati MSG ahead of Mahindra's Nyck de Vries and Mueller. A penalty for overtaking off-track meant McLaren runner Taylor Barnard lost 10th place to Vandoorne's team-mate Jake Hughes.
Jaguar had a terrible day. Evans was the only one of its four runners not to get put to the back of the grid for a throttle map infringement during qualifying but was relying on a late final attack mode to get into podium contention when he had his race-ending incident with Mueller.
His works team-mate Nick Cassidy and Envision pair Robin Frijns and Sebastien Buemi all opted to leave their attack modes very late and lurk towards the back, but were stuck among midfielders using the same tactic and couldn't make sufficient progress.
Cassidy ended up only 14th, behind Frijns and Buemi.
Leading finishers
1 Oliver Rowland (Nissan)
2 Antonio Felix da Costa (Porsche)
3 Pascal Wehrlein (Porsche)
4 Jake Dennis (Andretti Porsche)
5 Jean-Eric Vergne (DS Penske)
6 Maximilian Guenther (DS Penske)
7 Stoffel Vandoorne (Maserati MSG)
8 Nyck de Vries (Mahindra)
9 Nico Mueller (Andretti Porsche)
10 Taylor Barnard (McLaren Nissan)