Messi opened the scoring with a calm penalty before curling two almost-identical free-kicks over the wall and beyond the despairing dive of the Celta goalkeeper Ruben Blanco, on either side of half-time to wrap the game up in la Blaugrana's favour.
He conjured up an nearly identical strike at the start of the second half to complete his treble and match Cristiano Ronaldo's record of 34 hat-tricks in Spain's top flight.
Sergio Busquets, on as a first-half substitute, crashed in a late fourth as Barcelona moved back top above Real Madrid on goal difference.
Barca lead the standings on 25 points after 12 games, level with second-placed Real Madrid who eased to a 4-0 win at Eibar. "This (taking free-kicks) is something that he has mastered to perfection". If they do, we try to take advantage.
Ernesto Valverde's Barcelona are flawed and this win will not paper over the cracks, especially as one of which is extreme dependence on Messi.
Messi has scored nine goals in his last seven games throughout all competitions. Messi's treble came at the end of a week that began with a 3-1 defeat at Levante and was not helped by a goalless draw at home against Slavia Prague in the Champions League.
"With Leo in the team, anything is possible", Valverde was quoted as saying by Marca.
"Without him, the match it would have been very different, and we would have had an even chance of winning".