|Bermejo headed a controversial winner [EPA]
Mario Bermejo headed a last-gasp winner for Xerez to earn the basement club a dramatic 2-1 victory at home to Almeria that kept alive their hopes of avoiding relegation from the Spanish Primera Division.
At the other end of the table, Barcelona coach Pep Guardiola described Xavi as the greatest midfielder in the club's history after the playmaker risked aggravating an injury to help his side beat Villarreal 4-1 away in Saturday's late match.
The Spanish international scored one and had a hand in two more goals as Barca shook off the disappointment of Wednesday's European Champions League semi-final exit to Inter Milan.
Xavi picked up a calf injury against Inter and had been a doubt for the game.
"He had an injury that if he aggravated it could force him to miss the World Cup," Guardiola told a news conference.
"He is committed to this club and is an example for everyone. For this reason he deserves to be recognised as the greatest midfielder in the club's history."
Spain coach Vicente del Bosque will have been relieved to hear Xavi had done no further damage to his calf with the deadline day for the naming of his squad for South Africa only three weeks away.
The 30-year-old was voted player of the tournament when Spain won Euro 2008.
Xavi played the ball through for Lionel Messi to score the opening goal against Villarreal, curled in a free kick for the second, and helped in the build up to Messi's second, Barca's fourth, at the end.
Only 72 hours after the demoralising end to their European Cup defence, Barca moved four points clear at the top of La Liga with three games left to play.
Second-placed Real Madrid can close the gap back to one point at home to Osasuna on Sunday.
At Xerez, television replays showed Bermejo was in an offside position when he scored in the 93rd minute to set off wild celebrations around the stadium and scuffles between the rival players as the final whistle blew straight after.
The top-flight debutants played the whole of the second-half with 10 men and in an increasingly desperate atmosphere Almeria also had a player sent off in the closing stages.
Xerez stay bottom on 30 points with three matches left to play but are now five points adrift of 17th-placed Malaga and safety.
Felipe Caicedo scored a late equaliser to keep Malaga out of the bottom three with a 1-1 draw at home to Sporting Gijon but they are now level on 35 points with 18th-placed Tenerife.
The islanders, who have an inferior head-to-head record, were 2-1 winners over visiting Racing Santander and moved above Real Valladolid who drew 0-0 at home to Getafe.
Racing are 16th with 36 points.
Nikola Zigic scored twice to lead Valencia to a 2-0 victory at Espanyol that strengthened their hold on third place in La Liga and Spain's last automatic
Champions League qualification slot.
The towering Serbia striker, who will be playing at the World Cup in June, replaced David Villa early in the second half and changed the course of the game by netting twice from Vicente crosses in the 61st and 74th minutes.