MANAMA - Lewis Hamilton won the Bahrain Grand Prix on Sunday ahead of Mercedes teammate Nico Rosberg after a thrilling wheel-to-wheel duel, taking him level with Juan Manuel Fangio on 24 career victories.

Hamilton, who also won last weekend in Malaysia, finished 1.085sec ahead of Rosberg in another triumph for the Mercedes team who have won all three races this season. Sergio Perez in a Force India was third, a huge 24.067sec off the winner’s time, to give his team just their second podium finish. Red Bull’s Daniel Ricciardo, who had started in 13th place, was fourth, followed by Nico Hulkenberg in the second Force India and world champion Sebastian Vettel in the second Red Bull completing the top six.

The result left Rosberg, the Australian Grand Prix winner, still on top of the world championship standings with 61 points. Hamilton has 50 with Hulkenberg in third place on 28 points. The British driver had been cruising to victory in the 900th ever grand prix with a lead of more than nine seconds when the safety car was called out on lap 42 of the 57-lap floodlit race. Rosberg, who had been on pole, then briefly slipped past the Briton but Hamilton reasserted his authority under braking despite his medium tyres lacking the grip of the German’s softer options.

On the final lap, Hamilton consolidated to take his first win in Bahrain after a memorable close-quarters battle. “It’s great to see that we have such a great following here, I am so grateful to the team for getting us up here and this is my first win here in Bahrain which is nice,” said Hamilton. “It was really exciting, Nico drove fantastically well, it was so fair but it was so hard to keep him behind me, I was on a real knife edge at the end but just managed to take it.”

Despite Rosberg’s second place, the German was despondent he could not retake the lead in the closing stages. “It’s very disappointing. I hope to get it right next time,” said Rosberg, who hit back at critics who claim the dominance of Mercedes was bad for the sport. “It was anything but boring. We have the momentum now and we have to keep pushing.” Perez was celebrating his first podium since leaving McLaren.

“It means a lot. It is a very special podium for me,” said the Mexican who had been on the podium three times in his Sauber career. Hamilton had snatched the lead on the first corner from his pole-sitting teammate and gradually built a commanding lead. With the two Mercedes sprinting away, the cut and thrust of racing was behind them for the remaining podium places with teammate fighting teammate for positions which switched back and forth as the night race went on.

Down the field, Ricciardo was piling the pressure on Vettel with the world champion at one stage ordered to give way to the Australian. He told his team that he had lost his DRS system.

At the front, Rosberg then slipped inside Hamilton on lap 19 to briefly take the lead before the 2008 world champion reclaimed the advantage.

At the halfway mark, Hamilton was seven seconds up on Rosberg and by the 40th lap, Hamilton’s lead had extended to 9.5sec. But on lap 42, the safety car was called out after Pastor Maldonado’s Lotus T-boned the Sauber of Esteban Gutierrez who was sent into a somersault. Racing resumed four laps later with Hamilton going on to just hold off Rosberg while Ricciardo again slipped past Vettel who complained wearily over his Red Bull’s lack of power.

Felipe Massa in a Williams was to finish seventh, with teammate Valterri Bottas taking eighth. Fernando Alonso, a three-time winner at the track, and Kimi Raikkonen filled out the top 10 to complete a miserable day for Ferrari. McLaren’s Jenson Button, racing in his 250th grand prix, had been in the top five at one stage before being forced into retirement two laps from home.