It had been a torrid week for the Blaugrana, who lost 3-1 at Levante before being held to a goalless draw by Slavia Prague, but Messi scored a penalty and two superb free-kicks as his side returned to the top of LaLiga.
The Argentina international delivered much more than just goals on a night when only a win would be acceptable for the Spanish champion, frequently dropping deep and driving an otherwise sleepy Barcelona side into attack.
Messi's goals took his tally to nine in his past seven games in all competitions and drew him level with Cristiano Ronaldo as the player with the most LaLiga hat-tricks, having netted 34, and Sergio Busquets scored his first league goal of the season late in the game.
The defeat was Celta's fifth in a row and newly appointed head coach Oscar Garcia will have his work cut out as he tries to lift his side out of the bottom three.
An out-of-sorts Barca took the lead when Junior Firpo's cross hit Joseph Aidoo's arm as the full-back slid in to block it and Messi nonchalantly rolled a side-footed penalty into the corner of the net, sending Ruben Blanco the wrong way.
But five minutes before the interval, Pape Cheikh sprinted through Barcelona's midfield only to be fouled by Messi 20 yards from goal and Lucas Olaza bent a superb free-kick into the corner of Marc-Andre ter Stegen's net.
Not to be outdone, Messi restored Barcelona's lead with a glorious strike after Fran Beltran fouled Arthur, the club's all-time leading scorer curling a picture-book goal into the top corner from 25 yards.
Ousmane Dembele came off the bench and sent a shot just past the angle of post and crossbar after a jinking solo run early in the second half.
Moments later Messi struck again, stepping up after Frenkie de Jong was fouled and sending a carbon copy of his first-half free-kick looping beyond the diving Blanco to complete his hat-trick.
Pione Sisto tested Ter Stegen from a tight angle as Celta probed for a way back into the game but the hosts continued to dominate and Antoine Griezmann should have put the result beyond doubt when he fired straight at Blanco from close range.
Griezmann trudged off as Valverde sent Luis Suarez on for the last 17 minutes but it was fellow substitute Busquets who stole a slice of Messi's glory when he collected a poor defensive header and drilled a low shot into the net to make sure of the victory five minutes from time.