Despite letting slip a match point in the second set, the former world No. 3 went on to win 6-4, 6-7(7), 6-3.
It was the Wawrinka’s first top 10 win since the 2020 Paris Masters against Andrey Rublev.
Thiem, who has slipped down the rankings from world No. 3 to 182, lost 3-6, 4-6 to Hurkacz who never lost his serve and hit 12 aces during their match.
Sonego secured a 7-6 (2), 6-4 win and next faces American Sebastian Korda for a place in the semifinals.