The Briton had capitalised on a break between showers in the morning session to go top, and his position was assured as the rain returned to further disrupt the afternoon.
On top of the inclement weather teams also had to navigate a series of red flags as a total of eight stoppages punctuated the day.
Hamilton himself caused the penultimate red when he stopped between Turns 6 and 7 with little more than 20 minutes to go.
The day was then brought to a premature halt as Jules Bianchi, taking over from Adrian Sutil at Force India, also stopped out on track just before the first turn.
The sodden afternoon meant there was no change in the morning order.
Jenson Button therefore ended the final day second ahead of Jean-Eric Vergne, Bianchi and Esteban Gutierrez.
Sauber's rookie was one of the busiest drivers in the afternoon, although he too caused a red when he slid off and into the gravel at Turn 4 early on.
He resumed quickly and eventually clocked up 96 laps, making him the day's busiest man.
Giedo van der Garde put Caterham ahead of Ferrari as he edged out Felipe Massa by just over one tenth of a second.
Mark Webber, Max Chilton and Romain Grosjean meanwhile rounded out the top 10.
Williams men Valtteri Bottas and Pastor Maldonado - who shared the morning and afternoon respectively - managed a combined 36 laps without setting a time.
Bottas put in the lion's share on a morning he dedicated to pitstop practice, while Maldonado put in 13 laps in the wet afternoon.
The third and final winter test of 2013 will take place at Barcelona next week, running from February 28 to March 3.
Pos Driver Team Time Gap Laps
1. Lewis Hamilton Mercedes 1m23.282s 52
2. Jenson Button McLaren 1m23.633s +0.351 70
3. Jean-Eric Vergne Toro Rosso 1m24.071s +0.789 80
4. Jules Bianchi Force India 1m25.732s +2.450 96
5. Esteban Gutierrez Sauber 1m26.239s +1.957 61
6. Giedo van der Garde Caterham 1m27.429s +4.147 50
7. Felipe Massa Ferrari 1m27.563s +4.281 80
8. Mark Webber Red Bull 1m27.616s +4.334 64
9. Max Chilton Marussia 1m29.902s +6.620 51
10. Romain Grosjean Lotus 1m34.800s +11.518 41
11. Valtteri Bottas Williams no time 23
12. Pastor Maldonado Williams no time 13
- Sports & Recreation
- Motor Racing
- Jules Bianchi
- Jenson Button