21-year-old Riiber was leading going into the cross-country after a terrific jump that placed him against compatriot Espen Bjoernstad and home favourite Franz-Josef Rehrl.
Watch the Nordic Ski World Championships live on Eurosport and the Eurosport Player
The Germans, usually so dominant in the jumping, really struggled as defending champion Johannes Rydzek ended in 17th after the jumps, and Eric Frenzel further back in 22nd.
World Championships
Racers share joke in 4x5km final
02/03/2019 AT 14:33
That opened the door to Riiber, who put a big distance between himself and the rest of the chasing pack in the early period of the race.
However he was pulled in by Akito Watabe, Bernhard Gruber and Rehrl, which set up a dramatic finish.
Watabe led going into the final stages and he paid for that mistake as Gruber and Riiber easily passed him and took gold and silver respectively as Rehrl collapsed and had to settle for a distant fourth.
Victory is Riiber’s first world title and goes with the 10 World Cup wins he already has to his name as he closes in on his first World Cup title which could cap off a brilliant season for the prodigy.
World Championships
Germany clinch title by eight seconds from Norway
24/02/2019 AT 13:14