France's Mathis Desloges took the silver while Norway's Martin Nyenget won bronze after 10km of classic and 10km of freestyle cross-country skiing.
Desloges kept hold of his silver medal despite lengthy jury deliberations after he received a yellow card for cutting across a course marker while rounding a curve in the stadium. The move helped him gain several metres around the 13-km mark.
Klaebo traded leads with a tight pack dominated by French skiers and his fellow Norwegians through much of the race. He broke away near the end in a dramatic finish up the final hill, with time to wave at the cheering crowd before crossing the line.
The win kept 29-year-old Klaebo on course to pass compatriot Marit Bjoergen’s record of eight Olympic golds in the sport.
"I’m going to take one race at a time and then we’ll see. But it’s a pretty good start and with the weather and the crowds it was amazing out there," said Klaebo.
While the Norwegian cruised across the finish line, Desloges and Nyenget battled it out for second place, with the Frenchman edging out his competitor by half a ski length.
"It was just a mistake, I didn't want to gain place... I'd just like to say sorry," Desloges said. This is the first Olympics for the 23-year-old, who is currently ranked 25th in the World Cup standings.
Athletes for the most part appeared satisfied with the decision for Desloges to retain his medal.
“It’s not my decision, so it’s nothing I should be thinking too much about,” said bronze medalist Nyenget.
