MADRID  - An embarrassing blunder by Barcelona goalkeeper Victor Valdes handed Real Madrid a Spanish Super Cup lifeline Thursday despite slumping to a 3-2 first leg defeat at their Catalan rivals' Camp Nou home.

With Barca 3-1 ahead, and pressing for a fourth goal, Valdes was caught out inside his own penalty area as he tried to dribble the ball clear only to be dispossessed by a stunned Angel Di Maria who scored into an empty goal.

Pedro Rodriguez, Lionel Messi and Xavi Hernandez had earlier scored second-half goals to give Barca a convincing lead after Cristiano Ronaldo had put Madrid ahead on 55 minutes. Madrid coach Jose Mourinho questioned the legality of Barca's first goal.

"Barca played well, especially in the first-half when they did not allow us to play, but in the second we were able to change our game a little. It was a good game but their first goal was an error by the linesman and was offside," he said.

Barcelona coach Tito Vilanova, in charge of his first 'Clasico', was happy with his side's performance. "We controlled the game and we had the chance to go 4-1 ahead at the end, but that's football. We've won and we're ahead in the tie so I'm satisfied," he said.

Madrid had travelled without the injured Pepe as well as Nuri Sahin, Carvalho and Kaka who are all expected to leave before the close of the transfer window. Vilanova opted for Alexis Sanchez and Pedro Rodriguez to assist Messi.

While Barca did begin to control possession, it took until the 17th minute for the game's first real action when Gerard Pique tried his luck from long range but failed to hit the target.

Two minutes later Messi found Dani Alves with a delightful ball in space on the right and when he received the return pass his left-footed shot just missed the target. It was Messi again on 29 minutes who reacted quicker than the Madrid defence to find the space to hit a drive that went just wide of Iker Casillas's goal. Casillas was then finally called into action to divert over the bar a Pedro drive. Alexis Sanchez was finding some space down the right side for Barcelona and was unfortunate with a claim for a penalty when it appeared that Sergio Ramos had felled the Chilean on 39 minutes.

The interval came and went and the game continued in the same pattern until the 55th minute when Ronaldo, previously anonymous, outjumped Sergio Busquets to head home a Mesut Ozil corner. Barca's reaction was immediate and they were level within two minutes when a raking pass from Javier Mascherano found Pedro who hit the target.

Messi then went on a mazy run and released Dani Alves who forced a diving save from Casillas. The game had opened up and Mourinho switched Benzema for Gonzalo Higuain but it was Barca who continued to create more meaningful opportunities.

On 69 minutes, Andres Iniesta provoked a clumsy challenge from Sergio Ramos in the area with a quick drag-back of the ball and Messi converted the resulting penalty. Nine minutes later Iniesta was again the instigator when he threaded a pass through the Madrid defence to give Xavi the easiest of chances for Barca's third goal.

Barca had confirmed their supremacy and were looking the more likely to add to their tally in the final minutes until Valdes badly misjudged a backpass and Di Maria pounced to snatch a lifeline for Madrid.