Real Madrid needed a late penalty to see off a stubborn Getafe 1-0 at the Alfredo di Stefano Stadium and move four points clear at the top of LaLiga standings.
Zinedine Zidane's men suffered for long periods as the Champions League-chasing visitors pushed them with a high-pressing and physical game, but in the end, they bagged maximum points to open a sizable gap at the top.
They first came close to opening the scores in the first half when Vinicius Jr made good contact with Ferland Mendy's low cross inside the box, but his goal-bound effort was kept out by a stunning David Soria save.
The visitors though crumbled under pressure in the final third of the match, and with 10 minutes to go, Mathias Olivera caught Dani Carvajal inside the box to give them the chance to open the scores.
Ramos stepped up to convert beyond Soria with his eighth goal in the last 11 matches and edge them closer to the title.
Getafe will feel hard done as they could have left the Alfredo di Stefano Stadium at least with a point, which could have boosted their Champions League hopes.
Following the win, Madrid moved to 74 points at the top of the table, four ahead of Barcelona in second with only five matches to go.
Meanwhile, Jose Bordalas' men remain sixth on 52 points, three off fourth-placed Sevilla who occupy the last Champions League spot.
In the other two matches played, Osasuna picked their third consecutive win in a 2-0 victory away to Eibar, while Real Sociedad were 2-1 winners over Espanyol.