The 2008 world champion made a late start, after losing most of the morning to a gearbox issue on the W05, but worked his way to the top of the times as the afternoon progressed.
He fell just 0.02 seconds short of beating Felipe Massa's Sakhir circuit pre-season benchmark from Saturday's test and bumped Massa's Williams team-mate Valtteri Bottas from the top spot, after the Finn had led the way for most of the day before stopping on the start-finish straight with a mechanical issue.
Sebastian Vettel endured another frustrating day in Red Bull's RB10, suffering what the team described as "a mechanical issue at the front of the car", which pitched the world champion off at Turn 1 before lunch.
The German returned to the track in the afternoon, and racked up a total of 77 laps, but at reduced pace.
He wound up ninth fastest thanks to late improvements under the floodlights, but still over four seconds off Hamilton.
Bahrain F1 testing gallery
Fernando Alonso set Ferrari's fastest time of pre-season around the Sakhir circuit to go third fastest, after the F14 T caused one of eight red flags across the day when Alonso stopped at Turn 12.
Romain Grosjean's Lotus, Jenson Button's McLaren, and Nico Hulkenberg's Force India all suffered engine failures that curtailed their running early, while clutch issues forced Kamui Kobayashi's Caterham to stop prematurely too.
Jean-Eric Vergne enjoyed arguably Toro Rosso's most successful day of pre-season, clocking 74 laps and the fifth fastest time.
Adrian Sutil and Esteban Gutierrez split driving duties in the Sauber and racked up more laps between them (177) than anyone else.
Electrical dramas delayed Max Chilton, but the Brit made a late surge to seventh on the timesheet, splitting the Sauber drivers with Marussia's fastest lap of pre-season around this track.
- Sports & Recreation
- Motor Racing
- Felipe Massa