HOCKENHEIM, Germany -- Lewis Hamilton credited divine intervention and hostile local fans for his remarkable victory at the German Grand Prix.

Hamilton won one of the most dramatic races in recent memory from 14th on the grid, capitalising on a late rain storm and title rival Sebastian Vettel crashing out of the lead. He also survived a late investigation into a moment which saw him run over the line between the pit entry and the track.

Speaking on a video Mercedes released to its social media accounts on the evening of the win, he said: "What a day, man! That was the drive of my life. It's been the most trying day... the greatest day, the most emotional day probably. I'm exhausted and then I put everything in I have in to that. I always do but I managed to have more in me today.

"I can't believe that things happened the way I prayed about and the way I focused. Things don't always go the way... you throw the ball up serve and don't always hit an ace. Today every single lap was as I planned."

The result marked a seismic turnaround for the reigning champion. On Saturday he had been eliminated early from qualifying after his car suffered a hydraulic failure at the end of Q1. After that session, he quoted former South African president Nelson Mandela in a long Instagram message criticising "those who take joy in seeing other people fail or suffer".

After his win some 24 hours later, he revealed that he had been spurred on by the feeling that the Hockenheim had rallied behind Vettel, who grew up just down the road from the circuit.

"Today is one of the most unbelievable days for me because... I prayed as I always do before the race and my prayers were really answered. It freaks me out a little bit more than normal. And then to see the kind of biblical storm afterwards...

Lewis Hamilton moved back into the lead of the championship with his victory in Germany. Peter J Fox/Getty Images

"There was a lot of negativity before the race. When you come to England, going around I don't remember any of the fans booing. We've got quite a good group of fans in England.

"And when I came here, there was a lot of booing. The weird thing is that I was really happy about it. It was unusual. It's weird that I'm still happy. It was because I kept seeing individually, a couple of different British flags in amongst a hundred or a thousand... a sea of red and then you've got a British flag in there.

"Then you have people from Mexico, people from England, you have people I think from Nigeria or somewhere in Africa with Hamilton shirts on - the name Hamilton on, standing in amongst the red. And it was just so positive for me.

"That's why I said at the end, that love conquers all. And I really feel that the rain's come down and just washed away any negativity. It's a glorious day. It couldn't have been a better day for me and one that I will always remember."

The win helped Hamilton reclaim the lead of the championship from Vettel. Having arrived at Hockenheim eight points behind his rival, he travels to the Hungarian Grand Prix with an advantage of 17 points.