In the second race of the year, Hamilton seemed set for a lowly finish at best.
Having lost first place to Max Verstappen at Turn One on the first lap of an epic affair, the defending champion, chasing his rival, ran off into a gravel trap midway through the grand prix.
Hamilton was briefly stuck against the wall, struggling to reverse his car back onto the track, before the W12 limped towards the pit under a shower of sparks.
But a red flag prompted by an incident involving team-mate Valtteri Bottas then brought the race to a standstill.
Hamilton had been ninth and a lap down, yet the restart allowed him to weave through the field and claim P2, behind Verstappen but still ahead of the Red Bull man in the drivers' championship.
"I think, without doubt, getting back to second and getting these points will be very valuable through the season," said the Briton.
"If I'd lost 25 points, that would have been hard to recover based on the fact that [for] Red Bull it's the first time that they've had a championship-winning car.
"Their car is incredibly fast. They were faster than us this weekend, definitely in qualifying trim but it looks like a little bit also in race trim.
"I don't know if they made a couple of mistakes – I think they did, Max did in qualifying for example otherwise he would have been on pole.
"But we've got a real close battle. We love the fact that it's a close battle and it's great to see McLaren back up there after such a long time, it's great to see Ferrari looking strong.
"So, there's going to be a lot of exciting races up ahead and challenging for all of us in so many different ways."
Although Hamilton's resurgence prevented Verstappen from taking an early lead in the standings, the Dutchman was delighted to land a blow in the title tussle, having trailed the Mercedes man in the season opener.
But he was also not getting carried away after a first win of the year.
"It's a very long season. We just have to keep on working very hard," Verstappen said. "I'm very happy with the result today, of course, but that's today.
"I'm of course going to be happy about today, but tomorrow, we start again. We have to keep on improving because there's still a lot of work to be able to keep doing this the whole season.
"It's great to be fighting against Lewis, Mercedes who, I think, as a team, have been so dominant and they're very difficult to beat.
"To be able to sit here now, now two races in a row, we were very, very competitive – that's very promising but no guarantees."
With his nose pressed against the wall and rivals crashing elsewhere on the track in torrid Imola rain, Hamilton could easily have retired following his crash.
He was not to know then that the collision between Bottas and George Russell would provide a reprieve, but he was delighted to be able to continue and learn "an amazing lesson" regardless.
"I remember just sitting there, looking at the barrier, and I refused to think that the race was over," Hamilton said. "I refused to believe that the race was done.
"I could have obviously just turned the car off and got out but I'm grateful that I didn't.
"I'm grateful that I did do a reverse and then, after that, just kind of getting out the car and trying to switch the anger and turn it into positive energy so that I could get back in and race forwards.
"It's an amazing lesson to be sent and experience."
And Hamilton, so often starting from the front of the grid, actually relished the chance to blaze past the opposition from ninth place.
"I loved it," he added. "That's how my career actually started as a kid, coming through.
"We had a really dodgy, old go-kart, so I was always starting at the back. It just took me back to my roots."