Karim Benzema had given the hosts the perfect start as he stabbed home Alvaro Morata’s cross after just six minutes, but Barca were level just 12 minutes later when Lionel Messi equalled Alfredo di Stefano’s record for goals scored in Clasicos as he rifled in his 18th strike in clashes between the two.
The introduction of Cristiano Ronaldo from the Madrid bench livened up matters after the break and Madrid eventually found the winner when Ramos rose highest to power home Luka Modric’s corner, making it three defeats in four games for the Catalan club.
Barca still lead the table by 12 points and are 13 clear of Real but their woe was compounded in stoppage time as referee Miguel Perez Lasa didn’t award a penalty from what appeared to be a trip by Ramos on Adriano and keeper Victor Valdes was sent-off after the final whistle for his protestations.
That infuriated assistant coach Jordi Roura.
“I don’t have anything more to say about the refereeing. To me it appears perfectly clear if you look at the images.”
Ramos claimed not to be aware if there had been contact with the Brazilian.
“I don’t know if there was contact, I would need to see it on TV to have an opinion. However, there were also other decisions in the game and I don’t think it was a determining play in the game.”
Ramos said Real will keep on fighting against the odds to retain their title.
“In the league 13 points is better than 16. We have reduced the distance and whilst it is still possible mathematically we are obliged to fight.”
Coach Jose Mourinho had signalled that Tuesday’s Champions League clash with Manchester United was his priority as he made seven changes to the side that started the 3-1 win over Barca in the Copa del Rey semi-final second leg in midweek with Ronaldo’s initial absence being the most striking.
However, even without their talisman Madrid made the perfect start as Barca’s defensive woes of late continued when Morata swung in a delightful cross from the left and Benzema was on hand to prod the ball home from close range.
But Barca equalised with their first effort on goal 12 minutes later.
A nice through ball from Dani Alves put Messi in behind the Madrid defence and he turned onto his favourite left foot to score for the 16th consecutive league game.
The game then settled down into a familiar pattern with Barca happy to pass the ball around without overly threatening, but Messi did have a good chance when Raphael Varane failed to cut out a pass from David Villa on the edge of the box just after the half hour.
This time, on his right side, he couldn’t generate the power needed to trouble Diego Lopez.
The visitors started brighter after the break and nearly found their way through with a trademark move as Messi picked out Alves on the right and then just failed to get on the end of the Brazilian’s dangerous cross.
Another moment of magic from Messi then played in Villa but a wonderful recovering challenge from Varane denied the Spanish international a clear effort on goal.
Mourinho then unleashed Ronaldo along with Sami Khedira with just over half an hour to play and the Portuguese soon fired a rasping 30 yard free-kick towards goal that Valdes did well to turn behind.
Ronaldo came close again as he fired into the side-netting at the end of a solo run past three Barca players, before Morata spurned an excellent chance.
But the youngster’s miss mattered little six minutes later when Ramos outjumped Gerard Pique to leave Valdes helpless.
And the score could have been even more flattering to the home side as Ronaldo then fired a wicked free-kick off the angle of post and bar.