Hamilton will have another tough task at the German GP where he will start 14th on the grid with Sebastian Vettel claiming the front spot.
The pivotal moment in the race came under the safety vehicle prompted by Sebastian Vettel's crash.
He believed his position was recognised by the stewards.
"It was a small mistake but a big impact on the race", the German said.
"I am so grateful. I just want to keep pushing". A big thanks to God.
"I didn't think about it". It was so tough out there.
"Today I feel like I drove the best that I can remember driving".
Incredibly, the British driver is now 17 points ahead of Vettel after striking a devastating championship blow on his rival's home turf.
Race victor Lewis Hamilton of Great Britain.
Raikkonen retook the lead when Vettel crashed out but then opted to pit for fresh ultrasoft tires behind the Safety Car and dropped to third place behind the Mercedes pair.
Vettel got out of his Ferrari cockpit, and trudged across the gravel, kicking his right foot at the sand in frustration.
Hamilton chose to stay out on his ultra-soft tyres during the safety sar period that followed Vettel's accident, swerving away from pitting and crossing a patch of grass to re-join the straight.
The race resumed with just 10 laps to run, and Mercedes held their breath as Hamilton and Bottas went wheel-to-wheel for the victory.
Mercedes team chief Toto Wolff expressed sympathy for Vettel, noting how quickly fortunes can change in Formula One.
The Finnish driver duly obliged, and, despite the threat of a second rain shower, Hamilton crossed the line 4.5 seconds clear of his team-mate to move clear of Vettel in their battle for the championship.
Romain Grosjean took sixth for Haas ahead of Mexican Sergio Perez and Frenchman Esteban Ocon for Force India in seventh and eighth.
"Miracles do happen, mate", Hamilton's race engineer Pete Bonnington told him over the radio after a slow-burner that turned into one of the great comebacks of the Briton's already stellar career.
"I'm 100 percent sure that the ultras worked better plus I had very used tyres at that point already but I can't give an answer if it would have been just fine or a complete disaster, so that's always an unknown and you try to weigh up the differences and hope that the new tyres will give you some grip to come back".