Fernando Alonso put Ferrari back on top in the final free practice session ahead of Bahrain Grand Prix qualifying.
The Chinese GP winner produced a 1m33.247s lap on the softer medium tyres seven minutes from the end, and it proved unbeatable.
Earlier in the session Alonso had spun wildly out of Turn 2 while on a hard tyre run. He stopped just short of the gravel trap and was able to continue.
Sebastian Vettel looked best-placed to depose Alonso at the end, as everyone else fell shot on their medium runs.
The world champion's Red Bull had been on top for most of the session, and waited until the final seconds before heading out on medium Pirellis.
Vettel came across traffic halfway round his lap, prompting an angry gesture at Charles Pic. But even before he encountered the Caterham, Vettel's sector times were already shy of Alonso's.
Running very wide over the rough Turn 12 kerbs then stymied Vettel's next lap and he failed to improve on the 1m33.348s he had set on mediums, 0.101 seconds off Alonso's pace.
Mark Webber completed the top three in the second Red Bull.
Lotus duo Kimi Raikkonen and early pacesetter Romain Grosjean were fourth and sixth, sandwiching Lewis Hamilton.
The Mercedes had a dramatic end to its session when Hamilton suffered an apparent left rear tyre failure on his slowing-down lap. The car sustained suspension damage in the incident, but Hamilton was able to nurse it back to the pits.
Mercedes is now having to carry out a left-rear corner change before qualifying. It is unsure what caused the initial tyre problem.
Force India stayed with the frontrunners as Adrian Sutil and Paul di Resta took seventh and eighth, followed by Nico Rosberg's Mercedes and Nico Hulkenberg's Sauber.
Felipe Massa, fastest on Friday morning, was only 11th for Ferrari, ahead of the McLarens.
At the back, Marussia's Max Chilton had to sit out the latter part of the morning due to a KERS problem.
Pos Driver Team/Car Time Gap Laps 1. Fernando Alonso Ferrari 1m33.247s 12 2. Sebastian Vettel Red Bull-Renault 1m33.348s + 0.101s 15 3. Mark Webber Red Bull-Renault 1m33.380s + 0.133s 19 4. Kimi Raikkonen Lotus-Renault 1m33.446s + 0.199s 21 5. Lewis Hamilton Mercedes 1m33.455s + 0.208s 19 6. Romain Grosjean Lotus-Renault 1m33.464s + 0.217s 19 7. Adrian Sutil Force India-Mercedes 1m33.596s + 0.349s 17 8. Paul di Resta Force India-Mercedes 1m33.700s + 0.453s 15 9. Nico Rosberg Mercedes 1m33.764s + 0.517s 19 10. Nico Hulkenberg Sauber-Ferrari 1m33.922s + 0.675s 17 11. Felipe Massa Ferrari 1m33.949s + 0.702s 20 12. Jenson Button McLaren-Mercedes 1m34.117s + 0.870s 17 13. Sergio Perez McLaren-Mercedes 1m34.282s + 1.035s 18 14. Daniel Ricciardo Toro Rosso-Ferrari 1m34.577s + 1.330s 16 15. Valtteri Bottas Williams-Renault 1m34.611s + 1.364s 17 16. Jean-Eric Vergne Toro Rosso-Ferrari 1m34.678s + 1.431s 16 17. Pastor Maldonado Williams-Renault 1m34.833s + 1.586s 17 18. Charles Pic Caterham-Renault 1m35.816s + 2.569s 16 19. Jules Bianchi Marussia-Cosworth 1m36.731s + 3.484s 17 20. Giedo van der Garde Caterham-Renault 1m36.939s + 3.692s 16 21. Max Chilton Marussia-Cosworth 1m37.630s + 4.383s 7 22. Esteban Gutierrez Sauber-Ferrari 1m39.592s + 6.345s 28
AUTOSPORT Bahrain GP coverage: