Barcelona to win the Spanish Super Cup on away goals.
Real capitalised on two blunders to quickly go 2-0 up in the second leg at the Bernabeu, with Gonzalo Higuain and Cristiano Ronaldo firing in.
Barcelona had Adriano red-carded for hauling down Ronaldo but the visitors pulled one back through a superb 35-yard Lionel Messi free-kick.
Both sides then missed clear-cut chances before Real prevailed.
The defeat meant Tito Vilanova was denied his first trophy as Barcelona boss and he will need to look no further than his lacklustre defence for the reason.
He had warned his side that Jose Mourinho's Real Madrid outfit would have extra motivation, because not only were they chasing the first silverware of the Spanish season, they were also looking for their first win of the new campaign at the fourth attempt.
But his players did not heed his words and Higuain, who had an early shot saved, stole in after Barcelona centre-back Javier Mascherano missed Pepe's speculative lobbed clearance to sidefoot through the legs of keeper Valdes.
Another defensive mistake let in Ronaldo and, after audaciously back-heeling the ball over centre-back Gerard Pique, he bided his time before powering in a shot to put Real 4-3 ahead overall.
The hosts were scything through Barcelona's flimsy defence at will and Valdes had to fend away yet another Higuain effort in a one-on-one confrontation.
Barca briefly threatened and centre-back Pepe headed in a Xabi Alonso free-kick but the goal was disallowed for a push on Mascherano.
But the visitors were struggling to cope and Adriano's dismissal for a professional foul in the 28th minute only increased the size of their task, although Messi's spectacular free-kick just before half-time gave the visitors hope.
Pedro could have brought 10-man Barca level after beautifully controlling a long Mascherano pass, but his shot was saved by Iker Casillas.
In another captivating El Clasico there were plenty of chances as Barcelona strived for the goal that would have earned them an aggregate win, while Real attempted to put their arch rivals away once and for all.
New Real signing Luka Modric, on as a substitute, had a close-range strike blocked before Messi drove an injury-time shot agonisingly wide for Barcelona as the home side held on for their first Super Cup victory since 2008.