(CNN) -- Barcelona's Champions League title defense suffered a big blow in rainy London in midweek, and the Spanish club's hopes of a fourth successive La Liga crown were all but ended in similarly wet conditions on home turf on Saturday.
Real Madrid moved seven points clear of their archrivals with just four games to play after clinching a tense 2-1 victory in the "El Clasico" clash -- Barcelona's first home defeat this season, ending a 54-game run in all competitions at the Camp Nou.
Cristiano Ronaldo came out on top in his battle with Lionel Messi as his 73rd-minute winner took his league tally this season to 42 -- one more than the Argentine.
"We've taken a gigantic step in La Liga by defeating Barcelona," Real captain Iker Casillas told the club's website. "There are still points in play and we must show respect for our opponents, but winning here is taking an important step in the championship.
"We behaved like a true team. Cristiano did an excellent job, but all of us played well from start to finish. It was a very important match and we earned a difficult victory."
The match was ominously similar to Wednesday's 1-0 defeat by Chelsea, as Barcelona dominated possession despite slippery conditions -- but failed to capitalize against a Madrid side who lost 2-1 to Bayern Munich in the first leg of their Champions League semifinal.
While the English club caught Barca on the counterattack just before halftime, Real exposed the Catalan side's defensive weaknesses as Germany midfielder Sami Khedira scrambled in a 17th-minute opener after the home team failed to clear Angel di Maria's inswinging corner.
It was Real's 108th goal in 34 league games this season -- a new record, beating Los Blancos' feat in the 1989-90 season.
Barca coach Josep Guardiola brought Alexis Sanchez off the bench with just over 20 minutes to go, and the Chile forward made an instant impact as he bundled in an equalizer at the second attempt. Sanchez replaced Spain midfielder Xavi, who made a record 32nd Clasico appearance.
However, the home crowd's relief was shortlived as Ronaldo beat the offside trip to gather Mesut Ozil's fine pass down the right, and the world's most expensive player netted his 54th goal this season from an acute angle.
Messi has scored 63 in all competitions, but has now not netted in the last three Clasico matches -- and Barca have lost back to back for the first time since 2009.
Real's former Chelsea coach Jose Mourinho celebrated his second Clasico victory in 11 clashes, and first in the league, having won the Spanish Cup last year.
The 49-year-old has already won titles in England, Italy and his native Portugal, and was under big pressure to end Barca's dominance this season.
"I congratulate Real Madrid for their victory and also for their league title which I have no doubt they have clinched tonight," Guardiola told reporters, as he defended his decision to leave Cesc Fabregas and Gerard Pique on the bench.
"I selected the team which I thought had the best chance to defeat Madrid."
Real had held a 10-point lead just over a month ago, but three draws allowed Barcelona -- who had won 11 games in a row -- to entertain hopes of closing the gap to just one this weekend.
Guardiola's team still hold a 29-point lead over third-placed Valencia, who host Real Betis on Sunday.
In Italy's Serie A, fourth-placed Udinese's Champions League hopes were dented by a 0-0 draw with mid-table Chievo on Saturday.
The result left Udinese two points behind third-placed Lazio, who play on Sunday along with leaders Juventus and title-chasing deefnding champions AC Milan.
Napoli moved up to fifth with a 2-0 win at home to second-bottom Novara.