Despite taking a three-goal lead into half time, Barcelona survived a second-half scare from Mallorca to win 4-2 at Iberostar Stadium.
Xavi put the Blaugrana on the path to recovering from their shock midweek UEFA Champions League defeat to Celtic with a sumptuous free kick, and goals from Lionel Messi and Christian Tello ensured a comfortable lead at the break.
The hosts came back out fighting, though, and pulled two back through Michael Pereira and Victor Casadesus. However, Messi once more saved the day as he ensured that Barca's blushes were spared when he slammed in his 76th goal of 2012, breaking Pele's mark for strikes in a calender year in the process. Messi trails just German great Gerd Muller, who scored 85 goals in 1972.
Mallorca set out to stifle the Catalan giants, dropping midfielders back when out of possession to create a wall of bodies in front of their own goal. In time, Joaquin Caparros' team grew in confidence but was unable to take the chances that came its way. After blazing over from Ximo's cross moments before, Tomer Hemed saw his header turned around the post by a scrambling Victor Valdes in the 22nd minute.
But it proved only to be a brief scare for the Blaugrana, as a moment of pure quality saw them break the deadlock. From a central free kick 25 yards from goal, Xavi curled a majestic, pinpoint shot over the wall and into the top-left corner with 28 minutes on the clock.
Tito Vilanova's men had enjoyed more than 70 percent of the possession throughout the first half, and they finally put a worthy distance between them and the opposition with two goals in quick succession before the break.
First, Messi was afforded too much space for his low shot that left Dudu Aouate red-faced as the keeper allowed it to slip through his grasp in the 44th minute. Then, one minute later, Tello received the ball on the left and after cutting in-field onto his weaker foot, swept a powerful effort past the keeper and into the bottom corner.
Mallorca began its comeback in the 55th minute, as Javier Mascherano was caught in possession by Victor, who then lofted the ball to the far post where Pereira remained composed to fire over Valdes and in. Three minutes later, the deficit was halved as Victor sent a penalty straight down the middle following a handball from Sergio Busquets in the area.
But Barca used all of its experience to take the sting out of the game by holding the ball. They then extinguished any hope of a comeback as Messi rifled in an emphatic second following a brilliant knockdown from Alexis Sanchez.
Messi missed a fantastic chance to complete his hat-trick in the 88th minute, but the win means the Catalan side remains unbeaten this season and temporarily opens up a six-point gap over Atletico Madrid at the top of the Liga table.