Barcelona suffered at times but eventually overcame rock-bottom Xerez, who ended the game with nine men.

Pep Guardiola's makeshift side suffered some nervy moments at 2-1 before Zlatan Ibrahimovic scored the all-important third goal after 55 minutes.

Barca had looked comfortable following early goals from Jeffren Suarez and Thierry Henry, but Mario Bermejo pulled one back immediately and Xerez missed a couple of great chances to level before Ibrahimovic's strike.

Matias Alustiza and Fabian Orellana were sent off for cynical tackles late on as Xerez's evening ended miserably.

Kaka made a fairytale return to action as he climbed off the bench to net a late winner for Real.

The £56million summer signing from AC Milan had missed the last six weeks with a groin problem but he was back with a bang tonight, netting the decider against 10-man Zaragoza soon after appearing as a 75th-minute substitute.

Earlier, Madrid had taken a 50th-minute lead through Raul but relegation-battling Zaragoza, despite having Matteo Contini sent off two minutes later, still managed to draw level through Adrian Colunga on the hour-mark.

Valencia edged a step closer to a place in next season's Champions League after easing past freefalling Deportivo La Coruna, whose own hopes of returning to Europe now look all but over.

David Villa's first-half penalty earned third-placed Valencia the spoils and Los Che provisionally move seven points clear of fourth-placed Real Mallorca, who play Malaga tomorrow.

Valencia finished the game with 10 men after substitute Ruben Baraja was sent off in injury-time, but it happened too late for ninth-placed Depor to take advantage as the Galician side's miserable run continued.