The Brazilian clocked a best of 1:22.625s during a qualifying simulation run to be 0.8s faster than Mark Webber.
The Australian reported that he was happy with his two days in the car at Barcelona, despite completing only 69 laps on the final day (compared with 121 for Massa) due to technical issues.
“Not too bad today,” said Webber.
“We had a few niggles here and there but we did well and that's been the case over the whole weekend.
“We had a very productive test, no question about it. We have a whole raft of data to go through, so we'll see where the next test is and get ready for that.”
After suffering badly with reliability issues across the first three days in Barcelona, McLaren finally logged some decent miles – Hamilton putting in 107 laps.
Maldonado, D'Ambrosio and Schumacher all brought out red flags during the day, with their cars stopping on the circuit.
Those issues paled in comparison to Team Lotus's, with Jarno Trulli's day ending courtesy of a crash after just 18 laps.
With the Bahrain pre-season test now cancelled, teams will return to Barcelona on March 3 for the final test of the off-season.
The move will mainly affect tyre-supplier Pirelli, as it will not be able to test its tyres in a warm climate before the opening race of the season in Australia.
The Italian company has blamed the high dergredation observed during testing in Spain on the cool conditions.