The seven-time World Champion overtook long-time race leader Lando Norris late on. Norris – who was aiming for a maiden Grand Prix victory and was leading for most of the race – spun his McLaren in heavy rain.
Hamilton eventually finished over 53 seconds ahead of second-placed Max Verstappen, who had started at the back of the grid after Red Bull took a new engine.
As well as winning his 100th Grand Prix and becoming the first driver to achieve the feat, he moved back to the top of the driver’s championship standings ahead of Verstappen.
Hamilton – who surpassed F1 legend Michael Schumacher for the most race wins last year – thanked his team for helping him get to this point.
“It’s taken a long time to obviously get to [win number] 100 and I wasn’t even sure whether or not it would come,” Hamilton said after the race.
“So it’s good to see us united again and obviously the team made a great call right at the end,” he added.
“I didn’t want to let Lando go and of course I didn’t know what the weather was doing but I’m incredibly grateful to all these men and women that are here and back at the factory because, wow, 100.”
While it was Hamilton who ended up on top of the podium on Sunday, it was another Brit who seemed destined to create his own bit of history.
Norris, 21, claimed the first pole position of his career on Saturday, battling tough conditions to lead the pack.
And after briefly losing the lead of the race to Carlos Sainz, he impressively reclaimed it in the 13th lap.
While conditions were dry when the race started, a downpour in Sochi made conditions tough for drivers.
Norris and Hamilton initially stayed out, until with four laps to go, the Mercedes driver was advised by his team to switch to intermediate tires.
On slick tires with the rain falling more heavily, Norris was caught comfortably by Hamilton as the 36-year-old took the lead late on.
The McLaren driver lost speed as he tried to navigate the conditions, before losing control and spinning his car on the 51st lap.
He eventually finished seventh, and was clearly emotional afterward.
“I’m unhappy, devastated in a way,” he said after the race. “It was my decision, I thought it was the way to go.”
Hamilton praised his compatriot, saying he did an “amazing job.”
“He had incredible pace, he’s doing such a great job for McLaren, and it was very bittersweet obviously to see my old team ahead – they’re doing so well, obviously they won the last race – they’re doing fantastic.”