Spain beats Sweden to stay ahead in Euro 2020 qualifying
Substitutes Alvaro Morata and Mikel Oyarzabal also scored at Santiago Bernabeu Stadium to give Spain a comfortable five-point lead over second-placed Sweden after four matches in Group F. Romania is also five points back.
"It's a great result in a difficult match against a tough opponent," Ramos said. "We've taken an important step toward making it to the European Championship."
Ramos reached 20 goals with the national team, with seven coming since last year's World Cup. He is the national team's top scorer under coach Luis Enrique, who again was absent for personal reasons.
The result at the Bernabeu extended Spain's winning streak to five matches, and ended Sweden's seven-game unbeaten run.
Ramos converted a 64th-minute penalty kick after a handball by Swedish midfielder Sebastian Larsson following a cross by Spanish forward Marco Asensio.
Ramos also opened the scoring in a 4-1 win at the Faeroe Islands last week, when the central defender became the player with the most wins with a national team, surpassing the record of 121 previously held by fellow Spaniard Iker Casillas.
The captain was honored for the record before the match.
Monday marked Ramos' 165th appearance with the national team — two fewer than another Casillas record.
Spain scored another penalty in the 85th after Morata was brought down by Filip Helander inside the area. Ramos handed the ball to Morata, who calmly converted from the spot.
"It was a great attitude by Ramos to let me take the penalty," Morata said. "I hadn't even asked for it."
Oyarzabal closed the scoring with a shot from inside the area in the 87th for his first international goal.
Spain controlled the match at the Bernabeu, creating most of the significant scoring chances.
Rodrigo had a goal disallowed for offside in the first half, and Francisco "Isco" Alarcon came close with an uncontested shot from inside the area that just missed early in the second half.
Sweden lost forward Viktor Claesson because of an injury in the first half.
For the third straight game, Luis Enrique was absent and the team was led by assistant coach Robert Moreno.
"They only had one attempt on goal, so we are happy with the result and with the performance," Moreno said.
Luis Enrique has been working remotely from his home in Barcelona, receiving video feeds of practices and meeting his assistants virtually.
There is no timetable for the coach's return. Local media reports said his absence is due to a problem with a family member.
Qualifying will resume in September, with Spain playing at Romania, and Sweden visiting the Faeroe Islands.