Barca rally to beat Valencia
Valencia started the day as the unbeaten league leaders in Spain and Pablo Hernandez's strike before the break had their hosts on the rack.
The champions rose to the challenge in the second half, however, and fit-again Spain midfielder Xavi set up both goals to put them second with 16 points from seven games, ahead of Valencia on goal difference.
Jose Mourinho's Real climbed one point above both of them after the late game, two goals apiece from Gonzalo Higuain and Cristiano Ronaldo sweeping them past Malaga.
Earlier, Atletico Madrid overcame local rivals Getafe 2-0 with goals from Simao, whose free-kick went in after hitting the post and then the keeper, and Diego Costa.
Barca playmaker Xavi recovered from the sore tendons that kept him out of Spain's recent Euro 2012 qualifiers to start, but was given little space in which to work in the first half at the Nou Camp.
Valencia were dangerous on the counter and it was from a quick break in the 38th minute that Jeremy Mathieu pulled the ball back for Pablo to score.
Three minutes later, Barcelona goalkeeper Victor Valdes saved one-handed from Pablo after another rapid move on the counter and that miss proved costly.
Barca were much sharper after the interval and a wonderful one-two between Iniesta and Xavi sliced Valencia open down the middle for the scorer of Spain's winner in the World Cup final to net in the 47th.
"Equalising at the start of the second half was crucial. The win gives us confidnce for the coming games, especially the changes we made after the break," Iniesta told Spanish television. "In the first half we didn't control the ball and this was the key."
Cesar saved magnificently from striker David Villa soon after, but was helpless in the 63rd when central defender Puyol drilled a powerful header past him from a Xavi cross.
It was a frustrating night for Spain forward Villa against his former club and he was denied by Cesar again despite being put clean through in a one-on-one near the end.
Real Madrid had struggled for goals in the opening games of the season but after thumping Deportivo La Coruna 6-1 last time out they seem to have found their range.
Portugal's Ronaldo had a hand in all four goals and crossed for Argentina's Higuain to volley home the opener in the 30th minute, after the side had already hit the woodwork twice.
Malaga were combative and caused the visitors problems on the break, but Mesut Ozil broke