The world number one - who is aiming for a fifth successive title, began the match with a slew of errors and trailed 3-0 but battled back to claim a 6-4 6-1 victory.
The first set alone took 79 minutes, with Swiatek saving eight of the 11 break points she faced, but the Pole found her form in the second to move through to an intriguing clash with Bianca Andreescu.
Swiatek said: "For sure I didn't start well, and everybody could see that. I'm really happy with the way I reacted and how I improved in the first set.
"Also how different the second set looked to the first one because I could really reset and really change the way I played. That's the most positive thing for me."
Former US Open champion Andreescu did not begin the season after struggling with the exposure she has had since becoming a teenage superstar but in this tournament, she is producing some of her best tennis since last year's Miami Open.
The Canadian, now 21, defeated Croatian Petra Martic 6-4 6-4 on Thursday while third seed Aryna Sabalenka, another player who has been struggling for form recently, impressed in a 6-1 6-4 win over Madrid finalist Jessica Pegula.
In the men's event, world number one Novak Djokovic claimed a 20th win from 26 meetings against Stan Wawrinka to reach the quarter-finals.
Wawrinka secured his first victories for more than a year following foot surgery to reach the third round but looked weary from the start and was unable to trouble Djokovic, who eased to a 6-2 6-2 victory.
"It's great to see Stan back," said Djokovic in his on-court interview. "He won two tough matches and you could see he's not physically where he wants to be.
"But, nevertheless, he's Stan Wawrinka, he can hurt you if you give him time and I managed to do well I think. From the beginning I really moved him around the court and held my serve pretty comfortably except that loss of serve in the second set."
In the last eight Djokovic will contest a first match against eighth seed Felix Auger-Aliassime, who saw off Marcos Giron 6-3 6-2.
Second seed Alexander Zverev defeated Alex De Minaur 6-3 7-6 (5) while Stefanos Tsitsipas fought back from a set down to see off Karen Khachanov 4-6 6-0 6-3 and will next meet home hope Jannik Sinner.