Antoine Griezmann gave Barca a seventh-minute lead and Messi then took over with a couple of goals, either side of Ante Budimir's strike against the run of play.
On a day when the home side's front three clicked into gear, Luis Suarez added a fourth before the end of the first half with a sublime back-heel to round off a fluid passing move.
Budimir pulled another back for Mallorca 26 minutes from time, but Messi rounded off his hat-trick late on as Barca maintained their good form and overtook Real Madrid at the summit.
Marc-Andre ter Stegen claimed a second assist of the season with a quick goal-kick that Griezmann collected and lifted over Manolo Reina after racing through on goal.
Reina produced an impressive save to keep out the returning Sergio Busquets' header, but Messi found a way past the visiting keeper 95 seconds later with a 25-yard curler.
Mallorca, winless in seven away league outings this season, gave itself hope when Budimir's shot deflected off Clement Lenglet and looped over Ter Stegen.
But Messi took matters into his own hands with another trademark goal from range, before Suarez capped a fine piece of team play by back-heeling in from eight yards.
Reina frustrated Ernesto Valverde's men with a string of saves and Budimir then headed in from close range to once again give Mallorca a foothold on the game.
Barca made certain of a sixth win in a row in all competitions thanks to Messi's third of the match late on, the forward picking out the roof of the net after being teed up by Suarez to move onto 35 LaLiga hat-tricks in his career – one more than Cristiano Ronaldo.