Sagan emerged out of the final corner in the perfect position on Kristoff's shoulder and just had enough to edge past the home favourite as Australia's Michael Matthews took third.
Despite his disappointment in missing out on becoming the second ever Norwegian world champion, Kristoff flashed Sagan a wry smile as he shook his hand.
“He (Kristoff) is racing at home, I'm sorry but I'm very happy to win again!” said Sagan.
READ ALSO: Bergen to host Cycling World Championship
After his win, Sagan dedicated his victory to Italian Michele Scarponi, who died in April following a crash with a van near his home in Italy — he would have turned 38 on Monday.
“I want to dedicate this third world title first to Michele Scarponi because he has his birthday tomorrow. I'm very sorry this year, I want to wish luck to his family.
“And secondly I want to dedicate this victory to my wife, she's expecting a baby. It's a very nice finish to this season, I'm very happy.”
Sagan had revealed on Saturday that his preparation for the race had been disrupted by “sickness” and that he wasn't at his best.
He had hardly been seen throughout the 267.5km race but was part of the small group that made it to the final kilometre to contest the sprint finish.
And in winning he joined a select group of riders, including Belgian legend Eddy Merckx as three-time world champions, and the first to do so in successive years.
“It's something special, for sure it doesn't change anything, but for me it's something very nice,” he added.
Despite the length of the race it was only in the final 15km that a significant break was made that threatened to go all the way to the line.
Sagan and Kristoff cross the finishing line in Bergen. Photo: Cornelius Poppe / NTB scanpix
Frenchman Julian Alaphilippe attacked on the final ascent of Salmon Hill, the one climb on the 19km street circuit the peloton tackled 12 times.
Only Italian Gianni Moscon could follow him but was then dropped with 4.5km left.
Alaphilippe couldn't hold on, though, and coming into the final few bends a select group of 26 riders was there to fight for victory.
Only now did Sagan make his move and Kristoff didn't have the strength to hold him off.
Sagan admitted that he thought Alaphilippe, who looked hugely impressive when he attacked, leaving the likes of Olympic champion Greg Van Avermaet and former world champion Philippe Gilbert in his wake, might stay away.
“It's not easy guys, in the last 5km I said already it's done, he (Alaphilippe) has gone,” said Sagan.
“After, guys were changing in front, after I tried to go in a breakaway, after (Fernando) Gaviria tried to close (the gap) and after it came for a sprint — it's unbelievable!”
Earlier in the day a 10-man breakaway had set off from the flag but despite quickly building a 10-minute advantage, they had been go:bbled up with 80km left.
Another eight-man group with big-hitters including Dutchman Lars Boom and Tim Wellens of Belgium got clear but could never stretch their lead much beyond 30-seconds and they were brought back with 25km to go.
Alaphilippe at one point to have the strength to go the whole way but just as the drama intensified with 3km to go, a technical glitch meant the television cameras lost track of the racers.
By the time they came into the view of stationary cameras in the final kilometre, Alaphilippe had been caught and a sprint finish was a certainty.
At that point, few could have doubted that Sagan would prevail.
READ ALSO: Tank surprises cyclists during Norway race