Take a look for yourself. Barcelona were carved open as Guidetti raced into the box and, despite losing his balance, fired home at the near post.
Alaves were lively throughout and could have added a second goal soon after going ahead, Ruben Sobrino seeing a chance clawed away, while Ruben Duarte was denied by Gerard Pique's block.
Luis Suarez had broken the away side's tough resistance with a sweet volley from Andres Iniesta's cross 18 minutes from the end, setting the stage for Messi's dramatic and stylish victor.
With the converted dead-ball, according to OptaJose, the attacking maestro overtook rival Cristiano Ronaldo with the highest number of goals from a direct free-kick in La Liga since the 2003/04 season; 21 to 20.
With an 11-point lead at the top of La Liga and a Champions League last-16 tie against Chelsea coming up next month, things are looking good for Valverde's side this term.
Barcelona now have 57 points, 11 more than second-placed Atletico Madrid.
Coutinho could be given another opportunity to make an impact when Barca host Valencia in the first leg of their Copa del Rey semi-final on Thursday night.
Leganes beat Espanyol 3-2 at home with the help of two own goals from Mario Hermoso, who completed an unwanted hat-trick by scoring a late consolation strike for his side. If you get the first goal and are in front, it's easier but if not ...
Suarez scored for the eighth successive La Liga match to level before Messi struck a brilliant free-kick with six minutes remaining to give Barcelona all three points.
Leganes missed out on moving into the top-half of the table as Getafe scored a stoppage-time equaliser at Sevilla later in the evening.
Barcelona: Marc-Andre ter Stegen 7 (out of 10), Nelson Semedo 6, Gerard Pique 6, Samuel Umtiti 6, Lucas Digne 5, Paulinho 6, Ivan Rakitic 6, Andres Iniesta 7, Philippe Coutinho 5, Lionel Messi 7, Luis Suarez 7.