Another master strategy call from the Mercedes pit wall sold Ferrari on a two-stop race while the Brackley team's intention all along was dual one-stop races utilising the medium compound until the end (remember, this year's medium tyre is a degree softer but still longer-lasting than the compounds below it).
Ferrari showed great pace all weekend and there would have been no guarantee at Mercedes of a Hamilton victory even if he hadn't been forced to start from ninth place after a grid penalty.
The 28-year-old didn't have the pace to fight for pole position but his deficit to Ferrari's Sebastian Vettel, the ultimate race victor, was a relatively narrow four-tenths of a second.
The German looked in total control of the race in the opening laps as he led away from pole position, after Bottas passed Raikkonen into the first corner.
Red Bull team boss Christian Horner agreed it had been a "brutally frustrating" race.
BC-CAR-F1-Bahrain GP, 3rd Ld-Writethru, 811 Vettel wins Bahrain, Raikkonen's vehicle breaks mechanic's legAP Photo XLB112, XLB115, XLB109, HAS135, HAS136, XLB108, XLB107, HAS128, XLB118Eds: Adds details, quotes, photo links. Red Bull's Daniel Ricciardo started from 4th but was out of the race on lap 2 due to an electrical issue.
Sebastian Vettel scored his 49th career victory.
While positions four through 20 were jockeyed for in the opening laps of the race, the front remained more stable.
Hamilton, meanwhile, was picking his way up the order, soon moving into sixth place after heading down the main straight alongside Nico Hulkenberg, Alonso and Esteban Ocon, overtaking them into Turn 1.
Hamilton's grinning demeanour post-race at Yas Marina, given he had already wrapped up his fourth world title beforehand, hinted at the real answer, no matter what excuses he made about it being hard to pass. Bottas came in a lap later, but Mercedes mixed it up by fitting his auto with the medium tyres. His tyres were fresher and his vehicle was faster, yet Vettel defended his position and kept the W09 in his mirror, and crucially, just out of DRS range right until the end.
As the strategies played out, Mercedes initially assumed Vettel would pit and were telling Hamilton, now in third place after Raikkonen's problem, that the German would come out behind him. The latter turned out to be the case for Raikkonen on lap 36. One of the three mechanics working on the left rear, which had yet to be changed, was hit and dragged to the floor as the vehicle accelerated away.
Kimi Raikkonen has given his version of events following a botched Ferrari pit stop that left a mechanic hospitalised.
Meanwhile, Vettel was still leading from Bottas as the first round of pit stops began.
"I think it will vary from track to track".
Vettel started on the front row with Raikkonen, and Bottas started third.
"I came on the radio to say everything was under control, but that was a lie!"
Bottas finally pitted after 21 laps, in a 3.8 seconds stop for medium tyres that were expected to see him complete the race - while both Ferrari ran on softs. We definitely have to do a better job. The result was engine supplier Honda's best finish since returning to the sport in 2015 and, following their acrimonious split with McLaren past year, will have tasted even sweeter on the home turf of McLaren's Bahraini owners.
Ocon was rewarded for his relentless attack of Sainz, snatching 10th and the final point.
"I don't know what shape he is in". That was the original plan and then we diverted and the tyres I tried to make them last and nurse them as much as I can, and it worked.
Red Bull suffered their first double DNF since Korea 2010. "We will try to get them next time".