Hamilton's time of 1:23.282s was set during a dry interlude on a day disrupted by intermittent showers.
Former team-mate Jenson Button was second for McLaren, ahead of the Toro Rosso of Jean Eric Vergne.
Jules Bianchi staked his claim for the remaining Force India seat by setting the fifth fastest time.
The morning session featured several red flags when the weather was at its worst.
Felipe Massa skated into the gravel at Turn 4 after just ten minutes of running, with Giedo van der Garde narrowly avoiding an accident when he slid off at the final corner. The Caterham driver stopped again shortly before lunch. Vergne and Sauber's Esteban Gutierrez found the gravel at Turn 5 as the tricky conditions caught drivers out. Mark Webber also stopped on track while Gutierrez was simultaneously finding the gravel.
The Mexican also caused the first red flag of the afternoon session when he spun at Turn 4. Pacesetter Hamilton also stopped out on track during the final hour of running while the day came to a premature end when Bianchi parked at the pit exit with five minutes remaining.
Neither Williams driver set a competitive time as both Valtteri Bottas and Pastor Maldonado concentrated on pit stops.
The third and final pre-season test takes place at the Circuit de Catalunya next week, commencing on Thursday.
Day 4 times:
|3||Jean Eric Vergne||Toro Rosso||1:24.071||80|
|5||Jules Bianchi||Force India||1:26.239||96|
|6||Giedo Van der Garde||Caterham||1:27.429||50|
|8||Mark Webber||Red Bull||1:27.616||64|
|11||Valtteri Bottas||Williams||No time||23|
|12||Pastor Maldonado||Williams||No time||12|
All 4 days combined:
|5||Sebastian Vettel||Red Bull||1:22.197||150|
|12||Adrian Sutil||Force India||1:22.877||78|
|13||Mark Webber||Red Bull||1:23.024||172|
|14||Jean Eric Vergne||Toro Rosso||1:23.366||186|
|15||Daniel Ricciardo||Toro Rosso||1:23.718||143|
|16||Paul di Resta||Force India||1:23.971||144|
|19||Jules Bianchi||Force India||1:25.732||96|
|20||Giedo Van der Garde||Caterham||1:26.177||143|