Barcelona failed to extend their lead at the top of the Liga table to seven points, after they were held to a 2-2 draw by Celta Vigo on Saturday afternoon.
The visitors stunned their hosts when Daniel Wass and Iago Aspas combined to set up Maxi Gomez in the 20th minute. He was denied by Marc-Andre ter Stegen, only for Aspas to volley home the rebound.
Just two minutes later, Luis Suarez and Paulinho set up the unmarked Messi to finish past Ruben Blanco.
Barca then took the lead in the second half, when Suarez touched home a low Jordi Alba cross.