The Russians, competing as neutral athletes at Pyeongchang as punishment for a years-long Russian doping scandal, came back from one-goal down on a goal by Nikita Gusev with less than a minute left in regulation time to force overtime in one of the most pulsating finals in the history of Olympic hockey.
At their medal ceremony, the players team sang the Russian anthem over the sound of the Olympic anthem at the Gangneung Hockey Centre despite being barred from having their flag raised or anthem played.
The game was played hours after the International Olympic Committee (IOC) decided not to restore their delegation's Olympic status, which would have enabled them to march under their flag at the closing ceremony later on Sunday.
OAR down Germany in overtime to win gold
The team's assistant captain Ilya Kovalchuk said the players had discussed beforehand whether to sing the anthem if they were to win, and they agreed they would.
"We knew that we will do it if we win," said Kovalchuk, the all-time leading Russian goal-scorer in Olympic play.
Singing the Russian anthem on the field of play is a violation of the IOC's rules on neutrality, which were imposed on Russia as part of sanctions punishing the nation over systematic doping across many sports.
The victory marked the first time a team from Russia have won the gold medal in hockey since 1992, when the so-called Unified Team representing Russia and five other former Soviet republics beat Canada for the Olympic championship.
"It means a lot. We didn't win Olympics since '92," Kovalchuk said. "It was a while ago. That was our dream. That was my dream for when I was five years old, when I started playing. It's great and it feels good."