Granada forward Odion Ighalo had put the hosts ahead in the first half, but Messi equalised just five minutes after the break after Goalkeeper Tono failed to hold Cesc Fabregas' shot.
The World Player of the Year then scored his 301st goal ans Barca's second of the night as he curled in sensational free-kick past Kono. Messi's winner extended Barcelona's lead to 15 points over Atletico Madrid.
Barca made the trip to Granada without influencial playmaker Xavi Hernandez and striker David Villa, both suffering injuries, while Andres Iniesta, Jordi Alba and Carles Puyol started on the bench.
Despite missing key players Barca started in the usual way of one-touch football and dominating possession.
Granada defeated Real Madrid 1-0 two weeks ago, thanks to Cristiano Ronaldo's own goal, and thrashed Deportivo La Coruna 3-0 last time out.
Despite Messi's double and three points in the pocket, Barca had to deal with a late surge from the home side. Victor Valdes made two important saves to deny Granada a late comeback.
Barcelona, who will visit AC Milan in the last 16 of the UEFA Champions League on Wednesday, are currently 19 points ahead of third placed Real Madrid.