Barcelona thrashed Sporting Gijon 6-1 to go top of La Liga on a dramatic night in Spain on Wednesday as Luis Enrique announced he was stepping down as the Catalan club's coach at the end of the season.
Barca sneaked ahead of arch-rivals Real Madrid in La Liga after Zinedine Zidane's side came from behind with 10 men following the sending-off of Gareth Bale to draw 3-3 at home to Las Palmas thanks to two late strikes from Cristiano Ronaldo.
Lionel Messi scored for the fifth league game in a row to put Barca ahead in the ninth minute, heading Javier Mascherano's floated pass over goalkeeper Ivan Cuellar.
Sporting defender Juan Rodriguez clumsily knocked Luis Suarez's angled shot into his own net to double Barca's advantage two minutes later but Carlos Castro pulled one back for the visitors in the 21st minute from close range.
Suarez restored Barca's two-goal lead by ruthlessly volleying home and the Uruguayan was taken off at halftime, replaced by Paco Alcacer who got the fourth goal early in the second half following a layoff from Messi.
Barca had scraped 2-1 wins over Leganes and Atletico Madrid in their two games since the harrowing 4-0 defeat by Paris St Germain in the Champions League but got back into their groove against second-bottom Sporting.
Neymar struck a fifth in the 66th minute by curling a free kick inside the near post and Ivan Rakitic capped a resounding attacking display by thumping home from inside the area.
The result was overshadowed by Luis Enrique's revelation in his post-match news conference that he would quit Barca at the end of the season after three years in charge.
"I would like to thank the club for the confidence they have shown in me, it's been three unforgettable years," the former Barca midfielder said.
"In my work I'm constantly looking for solutions and that means I get no time to rest, I need to rest and that's my main motive for leaving."
Barca top the standings on 57 points, one ahead of Real, who have a game in hand on their arch-rivals as they seek a first league title since 2012.
Ronaldo stars for Real Madrid
Zidane's side clawed back from 3-1 down against Las Palmas thanks to Ronaldo, who converted a penalty and headed home from a corner one minute from time.
Real had looked to be on their way to a comfortable win over a Las Palmas side who had lost their last four games and had never won at the Bernabeu when Isco beat the offside trap to score in the eighth minute.
Las Palmas midfielder Tana responded with a brilliant piece of skill to skip past Sergio Ramos and blasted into the roof of the net two minutes later.
The game turned against Real when Bale was shown two yellow cards in under 10 seconds, first for kicking out at Jonathan Viera and then for pushing the striker in anger.
Viera fired Las Palmas into the lead from the penalty spot in the 56th minute after a handball by Ramos and Kevin Prince-Boateng stretched their lead three minutes later but Real, who had three goals ruled out, refused to give in.
"We are not happy with how we've been playing recently and things haven't been going our way in the last few games but you will always have moments like this in a season," Zidane told reporters.
"But we can't go crazy because we have done things very well this season."