Lewis Hamilton’s bid to win a fourth championship is hanging in the balance after a cruel engine failure robbed him of victory in the Malaysian Grand Prix.

Hamilton was on course to cruise to the 50th victory of his career at a sweltering Sepang and move at least five points clear of his sole rival Nico Rosberg, who fought back to finish third following a first-corner collision with Sebastian Vettel, in the championship race.

Ricciardo celebrates his win (Vincent Thian/AP)

But with 15 laps remaining, Hamilton’s Mercedes engine blew up in the most dramatic of circumstances to hand victory to Daniel Ricciardo with his team-mate Max Verstappen following him home to seal Red Bull’s first one-two finish in nearly three years.

Rosberg, who served what turned out to be a meaningless 10-second elapsed penalty following a banzai move on Kimi Raikkonen, is now 23 points clear of Hamilton with just five rounds remaining.

Following the engine failure, Hamilton posted an emotional message on his Facebook page, in which he thanked fans for standing out in the hot sun to support him.

Today, the pain is indescribable, but I truly …

He also said “I have 100% faith in my team, they have worked so hard both at the track, and factory, and I want to say a HUGE thank you to them.”