Japan’s Osaka was stunned by the Greek 23rd seed’s aggressive start, making 12 unforced errors and not landing one winner in a 21-minute opening set.
Osaka, 23, hid under a towel as she tried to compose herself and fought back to lead 3-0 in the second set.
But Sakkari, from 4-1 down, broke twice to win five games in a row for victory.
Sakkari, 25, celebrated with a loud roar as she earned the biggest win of her career, triumphantly hugging her team after beating a player ranked in the world’s top three for the first time.
The world number 25 will play Canadian eighth seed Bianca Andreescu in the last four, after she beat unseeded Spaniard Sara Sorribes Tormo 6-4 3-6 6-3.
“I’m so excited, I’m super happy. I have no words,” said Sakkari, who set up the meeting with Osaka after fighting off six match points against American Jessica Pegula in the last 16.
“Winning a match like that, where I faced six match points, helped me a lot today. I have made a lot of comebacks and that is probably my trademark.”
Osaka’s defeat means she will not be able to regain the world number one ranking from Australia’s Ashleigh Barty, who faces Ukraine’s Elina Svitolina in the other semi-final.
Medvedev knocked out in last eight
There was a surprise defeat in the men’s quarter-finals too as Russia’s top seed Daniil Medvedev was eliminated in straight sets by Roberto Bautista Agut.
The Spaniard beat Australian Open finalist Medvedev 6-4 6-2 in just 92 minutes to reach his fourth ATP Masters 1000 semi-final.
He will meet Jannik Sinner in the last four, having been beaten by the Italian 19-year-old in Dubai in March.
“I want to give Daniil all the credit, I know he is one of the best players in the world,” said Bautista Agut.
“He’s been winning a lot of matches, he’s number two in the world, so I’m very happy and proud about how I played today. I think I showed a great level on the court.”