Rybakina, who represents Kazakhstan, had not previously been past the second round at Roland Garros but she was in superb form against 23-time grand slam winner Williams, storming to a 6-3 7-5 win in one hour and 19 minutes to reach the quarter-finals.
Russian-born Rybakina was excellent value for her stunning win on Sunday, converting five of her seven break points and winning almost 60 per cent of points returning Williams' second serve.
Far from being disappointed at her early exit, Williams said she was just pleased to have put together a run of three consecutive wins on clay before Sunday's defeat.
"I got some good matches in here," Williams told a media conference. "I did not have the best clay-court season, but it was good to finally get some wins on clay. I'm in a much better place than when I got here.
"It was definitely close. There is literally a point here, a point there, that could change the whole course of the match. I'm not winning those points. That literally could just change everything."
Asked if it might be her final French Open match, the 39-year-old American said: "I'm definitely not thinking about it at all. I'm definitely thinking just about other things but not about that."
One of those "other things" will be Wimbledon, where she has been a singles champion seven times. Asked when she would travel to London for the tournament that begins on June 28, Williams said: "[I will] possibly go home and regroup and then get ready for London. But I don't know. I have to get there early for quarantine, so, yeah, it has to be pretty soon."
Rybakina, who will face Anastasia Pavlyuchenkova in the quarter-finals, had never faced Williams before.
She said: "When I was small, of course I was watching her matches on TV. It's difficult to expect anything because you watch on TV and it's completely different when you come on court and you feel the power and everything. I knew that the serve was going to be difficult for me to return. She's powerful, but I was ready."
PAVLYUCHENKOVA ENDS LONG WAIT FOR LAST-EIGHT SPOT
Pavlyuchenkova reached the quarter-finals of the French Open for the first time in 10 years with a 5-7 6-3 6-2 victory over 15th seed Victoria Azarenka.
It is the seventh grand slam quarter-final for Pavlyuchenkova, who is seeded 31st at Roland Garros, and her first outside Australia in five years.
The Russian had lost to Azarenka in five of their last six matches and looked set for more disappointment when the Belarusian powered back from 3-1 down to take the first set.
However, Pavlyuchenkova fought back in style, hitting 24 winners and making just 11 unforced errors over the next two sets to book her last-eight spot in two hours and nine minutes.
"It's tough to remember what I felt like 10 years ago," she said. "I'd say completely different. I'm very happy also now. I think I feel a little different. I feel more mature. It's a good moment, I'm enjoying it, but I've got work to do.
"I hope I show more maturity as well, smarter tennis, more consistent. I feel quite fit as well, considering the fact that I'm not the youngest on tour now.
"I know what I have to do and I know what I want to do; I'm trying to work for that."
Reflecting on her defeat, Azarenka said: "There's always some positives. The most positive thing I will say from this week, not the whole season, is that I've been able to play pain free. That was my goal here. Everything else is something that can be analysed later."
BADOSA AND ZIDANESK REACH QUARTER-FINALS FOR FIRST TIME
Paula Badosa will compete in her first grand slam quarter-final after overcoming 20th seed Marketa Vondrousova 6-4 3-6 6-2.
Badosa, who reached the semi-finals in Charleston and Madrid before picking up her maiden title in Belgrade a fortnight ago, saved six of the nine break points she faced and converted five of the 10 she forced on her opponent's serve.
"I always thought that tennis is 80 per cent mental," the Spanish 33rd seed said. "I think when you're in these rounds, of course the racket is important, how you play, it's very important.
"I think it's a little bit more important how you manage all the nerves in the important moments. I think when you're here, the mental thing, it's a little bit the key."
She will face world number 85 Tamara Zidanesk, who became the first player representing Slovenia to reach the last eight of a grand slam thanks to a 7-6 (7-4) 6-1 win over Sorana Cirstea.
The best previous major performance by a player representing Slovenia had been the three fourth-round runs by Katarina Srebotnik at Roland Garros in 2002 and 2008, and the US Open in 2008.
"I'm getting a lot of messages that everyone is watching," Zidansek said. "It means a lot to me that I'm able to get across to the message to young people and everyone in Slovenia that we can do it.
"We're a small country; we don't have that many players, but we have good players."