Hungary has captured its first Winter Olympic gold ever, winning a wild 5,000-meter short-track speed skating final.

As almost every 5,000m relay does, this final featured plenty of mayhem, including the host nation of South Korea crashing out, leaving just Hungary, China and Canada to battle for position on the podium. Hungary’s team of Shaoang Liu, Shaolin Sandor Liu, Viktor Knoch and Csaba Burjan were able to squeeze in with a time of 6:31:971, less than one-tenth of a second ahead of the Chinese team, which took home the silver ahead of the Canadians.

View photos Hungary’s 5000 meters speedskating relay team celebrates its historic gold medal. (AP Photo/Julie Jacobson) More

It was a tense atmosphere throughout the race, which includes numerous changeovers, teammates tagging other teammates in and skaters all over the ice, constantly either racing, circling to catch up with teammates or trying to get out of the way. Just over halfway through, when the South Koreans looked to have taken the lead via an aggressive move to the front of the pack, they crashed out. That opened the door for the Hungarians to make history, which they did thanks to a thrilling overtake on the final lap.

Hungary has sent athletes to every Winter Olympics since 1924, but before Thursday only had six medals — two silvers and four bronzes — to show for it. This medal was the first in the Winter Olympics for the Hungarians since Andras Sallay took silver in ice dancing in Lake Placid in 1980.

More Olympic coverage from Yahoo Sports:

• Adelson: U.S. women’s hockey caps new legacy with Olympics gold

• Passan: American halfpipe duo earns medals to match their tattoos

• Wetzel: How U.S. women’s hockey smiled in the face of enormous pressure

• Busbee: One road ends as another begins for Shiffrin, Vonn

• North Korea to troll South Korea, USA again at closing ceremony

