Two goals by Lionel Messi inspired leaders Barcelona to victory at Mallorca after the hosts had threatened to derail their visitors' bid for a 10th win in this season's Primera Division.
Barcelona were cruising at 3-0 up at half-time thanks to goals from Xavi, Messi and Cristian Tello.
However, Mallorca scored twice in four second-half minutes through Michael Pereira and a Victor Casadesus penalty but Messi struck to bring the hosts' comeback to a halt.
Messi was influential from the outset, forcing Dudu Aouate to intercept his cross from Xavi's free-kick from the right. Dani Alves' 20-yard shot was also repelled by the keeper.
Tomer Hemed volleyed over for the hosts in their first real attack of note and they almost went ahead midway through the first half, but Victor saw his header tipped round the post by Victor Valdes.
However, Barca were ahead five minutes later. Cesc Fabregas was fouled by Jose Luis Marti with Xavi firing the resulting free-kick into the top left-hand corner from 25 yards.
Fabregas shot over but Mallorca had a great chance to draw level, only for Anderson Conceicao to head over from inside the six-yard box.
They were made to pay for that failure when Messi gave Barca a 2-0 lead when he drilled the ball into the centre of the goal from 20 yards two minutes before the break.
And just a minute later the game appeared all but over when the visitors got a third, Tello firing home a fine 20-yard shot into the bottom right-hand corner.
Alejandro Alfaro mishit a shot when well placed in the six-yard box as Mallorca looked to make a dent in the scoreline.
And two goals in four minutes saw the hosts force their way back into the game.
First of all Pereira slammed the ball high into the centre of the goal from Alfaro's right-wing cross 10 minutes after the break.
Just four minutes later Mallorca cut the deficit to just one goal, Victor hitting a penalty down the middle following Sergio Busquets' handball.
However, rather than Mallorca going on to equalise, the next goal came from Barcelona with 20 minutes to go.
Alexis Sanchez laid the ball off to Messi who drilled a fierce shot high into the top left-hand corner.
The goal deflated Mallorca and it was Barca who came closest to scoring, Messi inches away from a hat-trick when Aouate tipped his shot over.