Messi struck his 300th and 301st goals for Barcelona as the Primera Division leaders overturned a half-time deficit to win 2-1 at plucky Granada.
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 caretaker coach Jordi Roura said: “We suffered. It’s logical. We knew how difficult it is to win in this stadium. Granada are a very physical side and they had nothing to lose. The match became complicated [after they scored] and, once again, [my] players dug deep [to get the result].”