The 30-year-old Briton, starting from the 42nd pole position of his career, led from lights to flag apart from two spells around the pit-stops to claim the 36th win of his career and his third in four races this year.
Hamilton came home 3.3 seconds clear of Finn Kimi Raikkonen of Ferrari who stole second ahead of Nico Rosberg when the second Mercedes driver suffered a braking problem on the penultimate lap.
It had seemed that the 29-year-old German would hold off Raikkonen's late challenge, but both Mercedes lost their brakes in the final laps, Hamilton just hanging on to win.
Hamilton's victory lifted him to 93 points in the championship, giving him a clear lead ahead of Rosberg, on 66 points.
Finn Valtteri Bottas of Williams finished fourth after resisting a late attack from German Sebastian Vettel in the second Ferrari.
Australian Daniel Ricciardo finished sixth for Red Bull, his engine blowing up as he crossed the line ahead of Frenchman Romain Grosjean of Lotus and Mexican Sergio Perez of Force India.
Russian Daniil Kvyat in the second Red Bull was ninth and Brazilian Felipe Massa, was 10th in the second Williams.
Hamilton: On the podium, confident
"I am gunning for it," Hamilton told triple world champion Jackie Stewart, doing the podium interviews, when reminded that he could also be a three times champion by the end of the season.
"The Ferraris gave us a real good run for our money, and out there it was really difficult to look after the tyres in these conditions," he added. "Fortunately I was able to keep the car together, keep the tyres as healthy as possible and got it through... I think we showed that Mercedes are still the best."
Unfortunate incident
Even the back of the grid was beyond the reach of McLaren's Jenson Button on Sunday after an electrical failure ruled the Briton out of the Bahrain Grand Prix before the start.
The 2009 Formula One world champion had been due to line up last, after failing to set a lap time in Saturday's qualifying and sitting out most of practice due to an electrical problem with the car.
Like Sports on Facebook, follow @ETribuneSports on Twitter to stay informed and join in the conversation.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ