World number one and hot favourite Swiatek admitted that the 22nd-seeded Rybakina deserved to win.
"I felt the pressure," Swiatek, 21, said. "I felt that I didn't want to lose instead of wanting to win."
Swiatek, who dominated women's tennis last year and is already a three-time major champion, added: "I felt today that I don't have that much left to fight even more.
"I felt like I took a step back in terms of how I approach these tournaments, and I maybe wanted it a little bit too hard. So I'm going to try to chill out a little bit more."
Swiatek follows second seed Ons Jabeur out the Melbourne exit door, the Tunisian having gone out in the second round in another surprise.
The American Gauff had been favourite to defeat Ostapenko, the 2017 French Open winner.
But the 25-year-old Ostapenko was always in control to ensure that Gauff must wait at least a bit longer for a first major title.
"I knew she's such a great player, super young and she's playing really well, but I really had nothing to lose," said Ostapenko.
"I just went there and tried to show my best and try to fight for every point, and to make it hard for her, and I'm really happy with the way I played."
Ostapenko, whose last Grand Slam quarter-final came at Wimbledon in 2018, has endured some tough injury-hit years since and had never before beaten a player ranked in the top 10 at the Australian Open.
"I was trying to stay positive all the time," said Ostapenko. "And I knew I have to play aggressive, even if I miss some balls."
Third seed Jessica Pegula and in-form fifth seed Aryna Sabalenka now look the women to beat, as both chase a first Grand Slam crown.
American Pegula faces 20th seed Barbora Krejcikova later Sunday in the fourth round.
The men's draw has also seen a series of surprise results.
Injury-hampered top seed and defending champion Rafael Nadal went out in round two to unseeded American Mackenzie McDonald in straight sets.
Second seed Casper Ruud is also out, as is the 2021 and 2022 runner-up Daniil Medvedev.
But nine-time Melbourne champion Novak Djokovic is still on the scene as he chases a record-equalling 22nd Slam title.
The fourth seed from Serbia is however nursing a hamstring injury.
Stefanos Tsitsipas is now the highest-ranking seed left in the decimated men's draw at three.
The Greek faces young Italian Jannik Sinner, seeded 15, later Sunday.
Karen Khachanov reached the quarter-finals after the Russian 18th seed swept past Japan's outclassed Yoshihito Nishioka 6-0, 6-0, 7-6 (7/4).