Sitting in fourth after his first two efforts, Hamilton produced a brilliant final lap and will lead an all-Mercedes front row, after teammate Valtteri Bottas recorded the second quickest time.
"We couldn't have expected this... the Ferraris were quicker all weekend, but the heavens opened and it was fair game," said Hamilton afterwards.
"It's so tricky out there, at the beginning it was dry and then it got wetter so it was hard to say how much grip we had.
"When it was drier it was a bit like doing ballet and tiptoeing trying to find a line. It was give and take all the way around. We've got a great position so we're going to do our best as a team and keep the red guys behind us."
Force India in financial difficulties
Esteban Ocon and Sergio Perez, Force India's drivers, came in 18th and 19th respectively but that wasn't the worst piece of news for team during the Grand Prix weekend.
The Silverstone-based outfit, formed in 2007, went into administration following a court hearing late on Friday in London but will compete on Sunday.
"We shall be engaging with key stakeholders on an urgent basis to secure the best outcome for creditors," said Geoff Rowley, representing joint administrators FRP Advisory LLP. "In the meantime, the team will continue to operate as normal, including racing in Hungary this weekend. Our aim is for business as usual whilst we assess options to secure the future of the team."
The Force India team, which is co-owned by Vijay Mallya, finished fourth in the constructors' championship last year with one of the smallest budgets in F1 and currently sit fifth in the standings for the current season..