Ferrari's pole-sitter Vettel looked comfortable in the lead and was en route to his first Formula 1 win in front of his home fans in Hockenheim, but things were turned on their head when rainfall arrived in the latter stages of the race.
That led to a costly error from Vettel, who crashed into the barriers and out of the race, and when the sister Silver Arrow of Valtteri Bottas and Ferrari's Kimi Raikkonen both pitted under the resultant Safety Car, Hamilton was in top spot.
And the world champion, who missed out on a win in front of his home fans last time out, held on to claim a triumph described as a 'miracle' by his team, and the Briton was understandly in buoyant mood.
“I feel all the rain has come down and kind of washed away the negativity,” said Hamilton. “That’s why I said at the end that ‘love conquers all’ (on the radio after the race). It’s just a glorious day. It couldn’t have been a better day for me. A real dream and one I will always remember.
“It’s too early in the season to ever really feel like it’s slipping away. It never feels good when you face adversity. The longer you endure it, the stronger you grow.
“Yeah, I definitely felt at one point that ’Jesus this is a steep hill for us’ but it’s ok, keeping believing, keep fighting, things will come good. Today is one of the most unbelievable days for me.
Hamilton trailed Vettel by eight points in the drivers’ standings ahead of the race, but the win, coupled with his rival’s heartbreaking retirement, means he now holds a 17-point lead over the Ferrari driver.
“There have been several crucial points where it’s been up and down, back and forth. The mistake from Sebastian today has been a benefit to us at Mercedes.
“It’s great to be here on Mercedes home ground – our second home. To get the one-two for Mercedes, particularly after they just re-signed us and confirmed their confidence in us, is a tremendous day for us.
“I don’t remember, actually I have ever had a race like this. After racing for so many years, you never know when you’re going to have another brilliant race. It’s difficult to ever think you’re going to have a better race than your best. I think this is now up there with them.”
The Mercedes one-two finish, after Bottas finished behind Hamilton in second, has helped the Silver Arrows to reclaim top spot in the constructors’ championship too. They now lead Ferrari by eight points heading to Hungary next week.