Ronaldo treble helps Real thrash Deportivo
Jose Mourinho's side fell behind to a Riki goal against the run of play in the 16th minute but the result was never in doubt after they stormed back to lead 3-1 at the break.
The victory continued their revival after a woeful start to their title defence - they have already lost twice, the same number of defeats in the whole of last season - and lifted them to sixth on 10 points from six matches.
Barca, who battled back from two goals down to win 3-2 at Sevilla on Saturday, have 18 points thanks to La Liga's only perfect record of six wins.
"We were a bit asleep at the start but after we fell behind we woke up and played a good match," Ronaldo, whose treble was his 15th La Liga hat-trick for Real, told Spanish television.
"We knew we couldn't afford to drop any more points and it was a very important win," he added.
"We know Barcelona are a very difficult side and we are playing away but we have to be focused and concentrated and trust that we can produce a good performance and win."
Undefeated Atletico Madrid climbed above Malaga into second on 16 points when Raul Garcia's 30th-minute header was enough for a 1-0 victory at bottom side Espanyol in Sunday's late game.
Malaga, who are also undefeated and have 14 points, thumped 10-man Real Betis 4-0 on Saturday.
After Riki's early strike at the Bernabeu, Real were level within seven minutes when Angel di Maria dashed in from the left and was felled by Manuel Pablo on the edge of the area.
Ronaldo stroked in the spot-kick before Di Maria made it 2-1 in the 39th minute when his initial effort was diverted on to a post by Depor goalkeeper Daniel Aranzubia and he followed up to nod the ball over the line.
Ronaldo added his second with a header from a deflected Sergio Ramos shot shortly before hal-ftime and Pepe glanced in another header from Xabi Alonso's inswinging free-kick in the 66th minute.
Ronaldo completed the scoring in the 84th minute when Evaldo handled in the area and the Portuguese converted his second penalty of the night, his 155th goal in 153 official games for the Spanish champions.
In Sunday's earlier games, Real Valladolid steamrollered visiting Rayo Vallecano 6-1 and are seventh on nine points and Osasuna and Granada secured their first wins of the campaign at home to Levante and Celta Vigo respectively.
Osasuna thumped Levante 4-0 and Granada saw off Celta 2-1.