The Spain captain was named in the starting line-up in Oslo for the Euro 2020 qualifier by coach Robert Moreno, 14 years since making his debut in a 3-0 friendly win over China.
Joshua King's 94th-minute penalty snatched Norway a 1-1 draw with Spain in the match, as the three-time champions were made to wait to qualify for Euro 2020.
Victory would have booked Moreno's Spain a spot at next year's finals, to be played at 12 venues across Europe, if Romania had failed to beat the Faroe Islands or Malta had beaten Sweden.
But those results did not transpire, and Spain will need to beat the Swedes in Solna on Tuesday to be sure of qualification with two games to spare.
Norway are still right in contention to finish in the top two and qualify after extending their unbeaten run to six qualifiers, sitting four points behind Sweden ahead of matches against Romania, the Faroes and Malta.
Spain started strongly and almost took the lead inside the first minute as home goalkeeper Rune Jarstein kept out Mikel Oyarzabal's effort.
But Norway, without injured teenage striker Erling Braut Haaland, grew into the contest before King’s dramatic late intervention.
“All that is personal is a little secondary,” said Ramos after the game.
“I would have happily traded this 168th cap for a victory. It was not the case. But this record is a great reward after so many years and it's a great source of huge pride.
“I am emotional every time I put on this shirt. That will not change and I hope to continue doing so for many years.”
Ramos is now only eight caps short of the European record held by Italian stopper Gianluigi Buffon (176) and 16 adrift of Egyptian Ahmed Hassan's world record of 184.
The 33-year-old was part of the Spain sides which lifted the 2010 WorldCup, Euro 2008 and Euro 2012 titles.
He took over the Spain captaincy in 2016 after goalkeeper Casillas' final match.
The centre-back equalled Casillas' previous record of 167 games last month.