The hard-fought win took Zinedine Zidane’s side on to 77 points after 34 games.
Ramos had converted a late spot-kick against Getafe in Real’s last match and the centre back once again showed nerves of steel by firing into the bottom corner in the 73rd minute to score a fifth goal in seven matches.
“I feel most comfortable during moments of the highest tension so I think I’m the ideal person to take on the responsibility at a moment like this,” said match-winner Ramos.
Athletic’s San Mames is one of the toughest away trips in Spain and the Basques have beaten Barcelona twice there this season in the league and Copa del Rey.
Real also faced a gruelling match even without any fans in the stadium, as the Basques continually closed them down and subjected them to their usual aerial bombardment.
Raul Garcia forced Real keeper Thibaut Courtois into a fine early save while Inaki Williams also proved a handful for the visitors.
Zidane’s side meanwhile missed three good opportunities before the break, with Rodrygo and Karim Benzema missing the target with close-range headers and Dani Carvajal bungling a pass which would have handed Benzema an open goal.
They finally found a way through when Marcelo sprinted into the area and had his foot clipped by the stray boot of Dani Garcia.
The referee went across to the pitchside monitor to review the play before pointing to the spot.
Athletic had a late penalty shout when Ramos appeared to tread on Raul Garcia later on but the incident was not reviewed and Zidane’s side clung on for a third consecutive 1-0 win, maintaining their flawless run since the season resumed after the coronavirus stoppage.
Meanwhile, Bottom side Espanyol were left on the brink of being relegated from La Liga for the first time in 27 years after they were beaten 1-0 at home by fellow strugglers Leganes.
Espanyol, who have been in the top flight since winning promotion in 1994, are on 24 points after 34 games. They are 11 points adrift of the safety zone and their fate could be sealed tonight if 17th-placed Eibar win at Sevilla. Should they survive that test they will need to beat champions Barcelona on Wednesday to avoid relegation.