Canadian Alex Harvey made a late push and pulled off a thrilling finish to win the 50-kilometre freestyle race at the cross-country skiing world championships in Lahti, Finland on Sunday.

Haywood Update <a href="https://twitter.com/alex_harvey">@alex_harvey</a> World Champion! 50k <a href="https://t.co/YksTtNweRC">pic.twitter.com/YksTtNweRC</a> —@cccski

Harvey posted a time of one hour, 46 minutes, 28.9 seconds to edge Russia's Sergey Ustiugov by 0.6 seconds. Matti Heikkinen of Finland finished third with a time of 1:46:30.3.

Harvey, 28, was in second place with five kilometres remaining in the race, which he claimed was an optimal position heading into the last turn.

The Canadian celebrated by playing air guitar in front of the crowd.

Haywood Update: <a href="https://twitter.com/alex_harvey">@alex_harvey</a> when you win the 50k, and still have energy for the traditional air guitar, you know you must be World Champion <a href="https://t.co/Cl0RsybInH">pic.twitter.com/Cl0RsybInH</a> —@cccski

"It was mayhem out there, it was such fast conditions that there was a really big group the whole way, so everyone was fighting to be in the front," Harvey told Finnish broadcaster YLE.

"People hitting each other's skis, the poles, so my goal was just to try to stay out of trouble."

Canada's Alex Harvey made a final push in the last corner of the 50km mass start, jetting ahead of Russia's Sergey Ustiugov for gold in Lahti, Finland. 0:34

In January, Harvey earned his first individual World Cup victory in three years when he won the 15km freestyle race in Sweden, and also finished at the top of the podium in the team sprint event along with Len Valjas in Italy.

"I've been feeling good all week and really all year...but the magic wasn't there," Harvey said. "Today everything was there including the magic."

Meanwhile, Ustyugov finished this year's championships with five medals, two of them gold.

It was the last event of the Nordic world championships, which saw Norway take seven victories to top the medal table.