Serena Williams had never before lost a singles match in the Olympics. (AP Photo/Charles Krupa)

Serena Williams just didn’t have it Tuesday, and the result was a huge upset at the Olympics. Ukraine’s Elina Svitolina knocked out the world’s No. 1 player in straight sets, 6-4, 6-3, in the third round.

The 21-year-old Svitolina, 20th in the WTA Tour rankings, committed 17 unforced errors to Williams’s 37. In addition, Williams saw her serve broken four times and had many more double-faults (8-2), including five in a pivotal second-set sequence that handed Svitolina a 4-3 lead.

Williams had suffered her first-ever loss in the Olympics just two days previously in a doubles match with her sister Venus as a teammate. Williams had reached the finals of all three major events thus far this year, and in July, she won Wimbledon for her 22nd Grand Slam singles title. She was also the Olympic defending champion in singles and doubles and had won a record-tying four gold medals in all.

Observers noted that Williams appeared to be struggling with a shoulder injury. In late July, she pulled out of the Rogers Cup in Montreal, citing shoulder inflammation.

In four previous matches, dating back to 2012, Svitolina had gone 0-4 against Williams and had only managed to win one set. Their most recent match, at the French Open in June, resulted in a 6-1, 6-1 rout by Williams.

Suddenly, the women’s gold medal is guaranteed to go to a first-time winner, and the only top-10 seeds left are Germany’s Angelique Kerber (2), the U.S.’s Madison Keys and Great Britain’s Johanna Konta (10), all on the bottom half of the draw. Svitolina’s next match will be against the Cezch Republic’s Petra Kvitova (11), with unseeded Monica Puig (Puerto Rico) and Laura Siegemund (Germany) squaring off on the other side of that draw.