Hungary led the 45-lap race when it mattered, leading the first lap and the last two.
"It's such a big honour. The journey was really long to get here. The team got qualified for the Olympics in eighth position, the last position, and we made it count. We're the winner," Shaolin Sandor Liu said.
The team of Csaba Burjan, Viktor Knoch, and brothers Shaoang Liu and Shaolin Sandor Liu won Hungary's first Winter Olympic gold medal and first medal of any color in 38 years. The Hungarian relay team also set a new Olympic record.
"It was a lot of pressure, if I have to be honest, from the whole country," Knoch said to the media. "I think everybody felt this weight on their shoulders and it was really hard to perform like this at the Olympics."
China and Canada finish behind Hungary on the podium. The silver medal was China's second medal of the day, after Wu Dajing won the 500m gold medal.
"We’ve done our best and gone beyond ourselves," Wu said to the media. "Whatever the result, it’s something we have to accept. As a team, we believe each other and work hard together. So in that respect, I think we’ve already done quite well."
Canada have now won a medal in the 5000m relay in five of the last six Games, after missing the podium at the 2014 Games.
"It's a big progression. We came into these Games wanting revenge. Especially since Sochi. Sochi we had kind of a medium performance. We wanted to do our best and I think with a medal, we just bring a pretty good response," Charle Cournoyer said.
A crash left South Korea trailing in the Final A, dashing their chances of being the third consecutive home country to win the 5000m relay after Russia and Canada completed the feat in 2010 and 2014. The hosts were gold medal favorites entering the race.
"The reason that this men’s relay is special to us is because we have invested most of our training time into this particular event," Kim Do-Kyoum said to the media "Again I say I’m sorry for not having lived up to the people’s expectations."
The United States won the Final B with a time of 6:52.708, marking the first time since 2002 that U.S. has not won a medal in 5000m relay. The U.S. are the world record holders in the event.