The 29-year-old Briton took full advantage of Mercedes team-mate Nico Rosberg's first non-finish of the season, due to gearbox problems, to reduce the German's lead in the title race to just four points.
Driving with great elan and speed, the 2008 champion Hamilton came home 30 seconds clear of second-placed Finn Valtteri Bottas of Williams, who started from 14th on the grid.
It was Hamilton's second home win at the British Grand Prix, his fifth of the season and the 27th of his career drawing him level with fellow-Briton three-time champion Jackie Stewart in the record books.
Later, from the podium, he added: "This just proves you should never give up! I have got so many mixed feelings and you never want to see a team-mate go out."
Australian Daniel Ricciardo, of Red Bull, finished third ahead of 2009 champion Briton Jenson Button, of McLaren, defending four-time champion German Sebastian Vettel in the second Red Bull and two-time champion Spaniard Fernando Alonso of Ferrari.
Both escaped serious injury, but Raikkonen, whose car was massively damaged, limped away and required later x-rays on his right ankle. Massa was forced out with a damaged car.
Danish rookie Kevin Magnussen finished seventh for McLaren ahead of German Nico Hulkenberg of Force India, Russian rookie Daniil Kvyat of Toro Rosso and 10th-placed Frenchman Jean-Eric Vergne in the second Toro Rosso.
