Bottas led virtually every lap at the Sochi Autodrom after passing pole-sitter Sebastian Vettel at the start, before holding off a late charge from the Ferrari driver in the closing stages.
Vettel crossed the line less than one second behind Bottas to extend his lead over Hamilton to 13 points.
Kimi Raikkonen completed the podium places while Hamilton, who has been off colour all weekend, ended up 36 seconds behind his team-mate.
“Amazing,” Bottas said as he reflected on becoming only the fifth Finn to win a Grand Prix. “It took quite a while – more than 80 races – but it is definitely worth the wait and definitely worth the learning curve.
“The strange opportunity to join this team came in the winter and they made it possible so thanks to them.”
Vettel was the overwhelming favourite to claim his third win from the opening four races after securing his first pole position in nearly two years, and with Raikkonen alongside him, Ferrari’s first front-row lockout since France in 2008.
But Bottas, who replaced defending champion Nico Rosberg at Mercedes this year, was fastest out of the blocks when the lights turned green.
Starting from third, he immediately pulled alongside Raikkonen before using the tow off Vettel’s Ferrari to take the lead on the 220mph run down to turn two.
Hamilton started well but was caught in a Raikkonen-Daniel Ricciardo sandwich and had to settle for fourth in the opening exchanges – the position in which he finished the race.
It was a bad day too for Fernando Alonso, who failed to start the race after his Honda engine packed up as the Spaniard made his way to the grid.
Britain’s Jolyon Palmer also had another day to forget. Palmer, who crashed out of qualifying on Saturday, was in the wall at turn two, although it looked as though Romain Grosjean was at fault.
The Haas driver bumped into Palmer, who lost control of his Renault and then inadvertently took both him and Grosjean out of the race.
“For f*** sake, I am out,” Palmer bemoaned on the radio. “He [Grosjean] was too ambitious,” Palmer added. “If you come in from the inside, it always bunches on the apex. I had cars outside me. I had to turn the corner and hope he used his brain.”
The safety car was deployed before returning to the pit lane at the end of lap three.
From there Bottas took charge, but Hamilton, in the sister Mercedes, was having a race to forget. The British driver, who has won two times in Sochi, was having trouble with the soaring temperatures on his Mercedes car. “There’s something wrong, I keep getting vibrations,” Hamilton said. Later, he added: “Why is my car overheating, guys? I am out of the race now.”
He was certainly out of contention for the victory, and despite getting to within two seconds of Raikkonen, never threatened the Ferrari driver for the final place on the podium.
At the front, Vettel stopped seven laps later than Bottas in an attempt to leapfrog the Mercedes man. But despite ending the race on fresher tyres, he was unable to get close enough to Bottas to prevent him from winning the first race of his Grand Prix career.
Vettel said: “I tried everything to catch Valtteri and I thought there may be an opportunity, but it doesn’t matter. A big congrats to Valtteri. It is his day.”