Andres Iniesta and Carles Puyol scored to help Barcelona to a 2-1 comeback victory at home to Valencia on Saturday, but it was Real Madrid which moved to the top of La Liga with a 4-1 win in Malaga.
Valencia started the day as the unbeaten league leader in Spain and Pablo Hernandez's strike before the break had the host on the rack.
The champion rose to the challenge in the second half, however, and fit-again Spain midfielder Xavi set up both goals to put it second on 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 it past Malaga.
Earlier, Atletico Madrid overcame local rival Getafe 2-0 with goals from Simao, whose freekick went in after hitting the post and then the keeper, and Diego Costa. Atletico improved to 13 points, while Getafe stayed on 10.
Barcelona 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.
Quick break
Valencia was 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.
Barcelona was 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.
"Equalizing at the start of the second half was crucial. The win gives us confidence 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.
Real had struggled for goals in the opening games of the season but after thumping Deportivo Coruna 6-1 last time out it seems to have found its range.
Ronaldo had a hand in all four goals and crossed for Higuain to volley home the opener in the 30th, after the side had already hit the woodwork twice.