MONACO, Monaco - An ill-judged gamble by Mercedes cost Formula One champion Lewis Hamilton his fourth win of the season, gifting his teammate and rival Nico Rosberg a third straight win at the Monaco Grand Prix and putting him firmly back in the title race.

Formula One's showcase race passes by the famed Monte Carlo casino, where big fortunes have been won and lost on its famed tables over the decades.

But Rosberg could never have imagined hitting the jackpot in such a way, as Hamilton was suddenly called back to the pits for a tire change shortly after a crash involving teenager Max Verstappen led to a safety car being deployed.

It was an astonishing mistake from F1's ultra-dominant team, with Hamilton more than 15 seconds ahead at that point. It led to an apology from Mercedes head of motorsport Toto Wolff, who seemed more baffled than convincing, as he explained that the decision was based on a technological data feed rather than any strategy.

"I don't think there has ever been a more bittersweet feeling than this one. We have won the Monaco Grand Prix and we have lost the Monaco Grand Prix all at the same time," Wolff said. "This is a day when we simply have to say sorry to our driver, because our mistake cost him the victory here. What happened? In simple terms, we got our numbers wrong."

Hamilton did not look happy, walking slowly and despondently out of his car with his head down.

"I can't really express the way I feel at the moment, so I won't even attempt to," Hamilton said.

The two-time champion had good cause to feel angry.

Rosberg, who won the Spanish GP two weeks ago, is now just 10 points behind after securing back-to-back wins for the first time in his career. Four-time F1 champion Sebastian Vettel is less of a threat, but the Ferrari driver finished second to close the gap on Hamilton to 28 points heading into the Canadian GP in two weeks' time.

Hamilton looked set to take his 37th career win after leading from the start, until the 17-year-old Verstappen rammed his Toro Rosso into Romain Grosjean's Lotus as he tried to overtake on the right.

That meant a safety car had to come out at the start of the 64th lap, at which point Hamilton was then called in to change to quicker and softer tires. After the change, he suddenly found himself behind both Rosberg and Vettel.

Hamilton then had only a few laps to try and get past them — on the most difficult track to overtake on F1.

Asked how he will respond, a dejected-looking Hamilton said: "Come back to win the next one."

Rosberg, who coincidentally launched his title bid at exactly the same stage last year, was modest in victory.

"I know that I got lucky today, so I'll just enjoy the moment now," the German said. "Lewis was a bit stronger today."

Russian driver Daniil Kvyat finished fourth for Red Bull's best result this season, while former champion Jenson Button finally earned McLaren its first points of the campaign by coming eighth. But teammate Fernando Alonso retired for the second straight race.

As well as securing his 10th career win, Rosberg became the first driver since Ayrton Senna to win Monaco three straight times. The others to do it were Frenchman Alain Prost and Briton Graham Hill.

But, happy as he was, Rosberg reached out to Hamilton.

"For sure it is an awful feeling," the German driver Rosberg said.

Verstappen — who had never driven on Monaco's sinewy street circuit before — tried to pass Grosjean but found no room and went spinning off.

Verstappen was handed a two-point penalty and a five-place grid penalty for the next race — although the daring teen blamed Grosjean for braking too early.

There was plenty of reason for Hamilton to cast blame, and the Briton angrily snapped over the radio: "Please stop talking to me, please" as the race was drawing to a close.

As Rosberg and Vettel celebrated warmly with each other, Hamilton took a long while to join the other two on the podium, but made the point of shaking Rosberg's hand.

Asked if he would respect his team's decisions from now on, Hamilton — who did not directly criticize his team — replied bluntly: "Yes."

But he will be hurting badly heading into Montreal, where Mercedes' team strategy will be closely scrutinized.