Messi scored with a penalty and then a pair of sumptuous free-kicks either side of half-time after Lucas Olaza had briefly pulled Celta level with a free-kick of his own at Camp Nou. Sergio Busquets drove home to make sure of the win late on.
A 34th treble in La Liga puts Messi equal with Cristiano Ronaldo, while a much-needed win sends Barca above Real Madrid on goal difference and back to the top of the table at the end of a testing week.
"It is impossible not to depend on Messi, he illuminates everything," said Valverde. "We depend on him like any team would depend on him. He unlocked the game".
Madrid had briefly claimed first place after continuing their own goal-surge by hammering Eibar 4-0, a game in which Karim Benzema scored twice and Eden Hazard exploded into life.