Riske, who is the current world number 55, fought back from a set down to win 3-6, 6-2, 6-3.
In this one hour and 36 minutes battle, Riske stunned Barty to clinch her maiden Grand Slam quarter-final berth.
Barty, who won the 2019 French Open, was in commanding form at the Wimbledon.
She hadn't lost a set prior to this match against Riske.
Getting to the quarter-finals is amazing, says Riske
"Getting to the quarter-finals is amazing but what's most exciting for me is the way I've been fighting. The grass definitely brings out the best in me. Hopefully it will rub off and happen in other places too," said Riske after her win.
Serena reached the quarter-finals after a dominant display against Spain's Carla Suarez Navarro.
The 37-year-old enjoyed a 6-2, 6-2 victory against the world number 31.
"I have more matches this week than in the past five months, but it is good," said Williams.
She is playing the mixed doubles as well.
Wins for Svitolina, Strycova and Zhang Shuai
Meanwhile, Ukrainian eighth-seed Elina Svitolina also progressed into the last eight with a 6-4, 6-2 win against Petra Martic. There were wins for Barbora Strycova and Zhang Shuai as well. Strycova beat Elise Mertens 4-6, 7-5, 6-2. Whereas, Shuai beat Dayana Yastremska 6-4, 1-6, 6-2.