© AP Photos
The hosts took the lead just after the quarter-hour mark when Messi slotted home from close range after neat build-up by Jordi Alba.
Barca soon retook the lead in the 29th minute when Messi fed Alex Song on the edge of the area to fire home.
After a good period of possession for the visitors it was Barca who opened up a two-goal lead when Messi found the bottom corner from outside the area to notch his 78th goal of 2012.
It was almost four 10 minutes before the end when Andres Iniesta lashed goalwards and back off the crossbar.
Victory for the Catalan club means they extend their lead at the top of La Liga to six points.