The hosts took the lead in the 22nd minute when Juanfran's effort hit the hand of Sergio Busquets. Jose Barkero calmly placed his penalty down the centre of the goal to put Levante ahead at the break.
Barca finally drew themselves level just after the hour as Messi smashed the ball into the far corner following a pass from Alexis Sanchez.
The Argentine put his side in front from the spot with 20 minutes to play following Pedro Botelho's collision with Isaac Cuenca.
The brace has seen Messi join Real Madrid's Cristiano Ronaldo on 41 league goals for the season.