Sebastian Vettel ended his and Ferrari's Formula 1 win droughts as he beat Mercedes' Lewis Hamilton to victory in a thrilling Malaysian Grand Prix at Sepang.
The German chose to stay out during an early safety car period and assumed the lead.
Vettel then made a two-stop strategy work while Mercedes did three stops with Hamilton and Nico Rosberg.
It proved to be the wrong call for the world champion team as neither Hamilton nor Rosberg had the pace, tyre longevity or enough laps to catch and pass Vettel in the final stint.
It was Ferrari's first victory since the 2013 Spanish Grand Prix, and Vettel's first since that year's season finale in Brazil.
Hamilton retained the championship lead on 43 points, with Vettel three points adrift and Rosberg, who finished third, seven further back.
After a dominant performance from Mercedes in Australia, F1 received a massive boost as Ferrari provided a sterner challenge to the reigning world champion team.
Vettel held onto second at the start, behind Hamilton, and chose to stay out when the safety car was called into action following Marcus Ericsson's spin into the Turn 1 gravel on lap four, while Hamilton and Rosberg, in third, pitted for hards.
Vettel pitted at the end of lap 17 and fitted the medium tyres before chasing down and passing both Rosberg and Hamilton on their older rubber.
The Mercedes had needed to fight back through traffic as several midfield cars followed Vettel's strategy and Rosberg was delayed in the pits queuing behind Hamilton.
Mercedes then split strategies when it pitted Hamilton and Rosberg for the second time, with Hamilton taking the mediums and Rosberg the hards.
Vettel only made his final pitstops with 14 laps to go after a long middle stint, taking on the hards and crucially rejoining ahead of Rosberg in second.
The Ferrari driver then regained the lead when Hamilton pitted and had hard tyres fitted a lap later.
The world champion was unhappy with the choice, with the Briton saying on team radio: "This is the wrong tyre, man," but being told Mercedes only had used mediums as an alternative.
While Mercedes assured him that he would be in a position to catch and pass Vettel for the win, it soon became clear that that wasn't the case, with Hamilton unable to close on Vettel.
Kimi Raikkonen recovered to a strong fourth in the second Ferrari having dropped to the back of the field following a puncture sustained in contact with Felipe Nasr's Sauber on the first lap.
Valtteri Bottas passed Williams team-mate Felipe Massa with a brilliant late move around the outside at Turn 5 to finish fifth, with the duo followed by Max Verstappen, who passed Toro Rosso team-mate Carlos Sainz late on.
Red Bull's Daniel Ricciardo and Daniil Kvyat, who recovered from a spin having made contact with Force India's Nico Hulkenberg, completed the top 10.
Romain Grosjean had an eventful race, the Frenchman trying an ambitious move around the outside of Sergio Perez at the fast Turn 12, only to clip the Force India and spin.
Though he rejoined, he finished outside the points in 11th, with Perez receiving a 10-second time penalty for causing the incident and ultimately finishing 13th. They sandwiched Nasr.
Hulkenberg was 14th in the Force India, having been given a 10-second time penalty for hitting Kvyat at Turn 2, with Manor's Roberto Merhi the last driver to see the chequered flag in 15th.
Pastor Maldonado retired the Lotus, having run well down the field after picking up a puncture on the first lap, while the McLarens showed improved pace but had nothing to show for it as Fernando Alonso and Jenson Button retired with mechanical problems.
Will Stevens did not start the race - his Manor team was unable to cure the fuel system issue that stopped his car running in qualifying.