Medvedev helped seal his own fate in the sixth game of the final set as he double-faulted four times to hand his Greek opponent to a 4-2 lead.
Unseeded Keys was thrilled with her defeat of Swiatek, against whom she had lost two prior matches.
Top seed Medvedev, who plays on Thursday for a quarter-final spot against Denis Shapovalov, can tighten his grip on his current top position heading into the US Open.
"All she has achieved is inspirational. It's a true honour to share the court with her," says Emma Raducanu of Great Britain.
That is also why Djokovic is not expected to be able to enter the US Open, the year's last Grand Slam tournament, which begins in New York on August 29.
Police said the gunman opened fire at the loading dock of the building and then entered the bank's lobby where he exchanged gunfire with police.
Rafael Nadal, Karolina Pliskova matches postponed by rain at Cincinnati Masters; Simona Halep advances
Pliskova led qualifier Camila Giorgi 3-0 when play was suspended while Nadal and Albert Ramos-Vinolas never started their third-round match.
The seventh seeds edged past Juan Sebastian Cabal and Fabio Fognini 5-7 7-5 10-8 in a second round match.