Barca dominated possession for the first 25 minutes, but were stunned when Odion Ighalo put the hosts ahead at the Estadio Nuevo Los Carmenes.
Messi tapped in a deserved equaliser five minutes into the second half, though, and then curled in a trademark free-kick 17 minutes from time to complete the turnaround and move Barca 15 points clear at the summit.
Barca assistant coach Jordi Roura, still overseeing first-team affairs with head coach Tito Vilanova undergoing cancer treatment in New York, shuffled his pack for the game, restoring Dani Alves, Javier Mascherano, Sergio Busquets, Cesc Fabregas and Pedro Rodriguez to his line-up, with Xavi (thigh) and David Villa (ill) among those to miss out and Andres Iniesta only on the bench.
Granada were unchanged from the starting XI which won 3-0 at Deportivo La Coruna last weekend as they looked to continue their promising start - two wins in two games - under new coach Lucas Alcaraz.
Messi's neat pass put Alexis Sanchez through on goal after four minutes, but Granada goalkeeper Tono was off his line quickly to smother the danger.
Former Barca B player Nolito had Granada's first sight of goal three minutes later, Victor Valdes gathering his side-footed volley at the second attempt.
Barca had a decent penalty shout waved away midway through the first half when Fabregas appeared to be clipped from behind by Gabriel Torje.
Alexis, who netted his first goal of the season in last weekend's 6-1 thrashing of Getafe, was provided with another presentable chance by Messi but took too long and the threat was snuffed out by defender Diego Mainz.
Moments later, at the other end, the hosts showed their illustrious opponents how to apply the cutting edge in front of goal as they took a shock lead.
Carlos Aranda's cross from the right was tapped back across goal by Nolito for Ighalo to stab home from close range - with Valdes and Barca defenders appealing in vain for offside.
The play soon switched back to Granada's defensive third, where Adriano went within inches of finding an instant response. His superb effort with the outside of his left foot whistled just past the top corner.
Granada defender Guilherme Siqueira was lucky to be shown only a yellow card 12 minutes before half-time when he hauled Pedro to the ground as he looked to burst through.
Aranda should have made it 2-0 on the stroke of half-time after being gifted the ball on the edge of the Barca box by a sloppy defensive free-kick by Thiago Alcantara, but Valdes made the save.
Just as they had done against Real Madrid a fortnight ago, Granada held the half-time lead. However, this time it lasted only five minutes into the second period.
Parity was restored when Messi pounced on the rebound to prod home after Tono could only parry a low Fabregas drive. It was the prolific Argentina forward's 36th goal in La Liga this term - and meant he had scored in 14 straight games.
Alexis again pondered for too long on the ball when put through down the left by Fabregas, the Chilean getting the ball caught up in his feet as an unmarked Pedro cut a frustrated figure waiting for the cross.
That turned out to be Alexis' last action as he was replaced by Cristian Tello.
Pedro went close to putting Barca ahead midway through the second half with a long-range blast which struck the inside of the left post and rebounded to safety with Tono beaten.
Seconds later Barca had a goal correctly ruled out for offside. Tello threaded a pass through for Dani Alves, who crossed for Pedro to prod home but the flag was raised.
Iniesta was introduced in place of Pedro with 18 minutes remaining, and a minute later he was celebrating Messi's second goal.
Thiago was fouled by Youssef El Arabi 25 yards from goal and the four-time Ballon d'Or winner stepped up to curl home a left-footed set-piece. Tono, diving to his right, got a hand to it but was unable to push it around the post.
Tello should have wrapped things up six minutes from time when he was on the end of a well-worked move, but lashed over the bar.
Granada substitute Yacine Brahimi was then denied a stoppage-time equaliser by Valdes after a slick one-two, and there was still time for Messi's hat-trick attempt to be thwarted by Tono, but there were no further goals.