In the women's draw, No. 2 Amelie Mauresmo of France and No. 3 Justine Henin of Belgium also were upset, marking the first time three of the top four seeds have been eliminated from a Tier I WTA tournament.
Not only did Safin endure an unexpected loss, his hometown crowd turned on him. After serving for the match at 5-4 only to lose the third-set tiebreaker, Safin was booed off the court by the supposedly partisan fans. That negative reception prompted Safin to declare he would never play in Russia again.
The 21-year-old Safin was trying to make a late-season bid to qualify for the Tennis Masters Cup in Sydney in mid-November. He is 11th in the ATP Champions Race, with five of eight spots still up for grabs.
Hrbaty, who also defeated Safin at the Australian Open and the Davis Cup this year, saved one match point as he improved his lifetime record against the 2000 U.S. Open champion to 6-4.
"I felt I was the better player on the court today," Hrbaty said. "When Marat served for the match at 5-4, I told myself that I could not be unlucky again. I had lost to (Yevgeny) Kafelnikov in Tashkent after holding a match point and he had a lucky let-cord winner."
Hrbaty will battle Jiri Novak of the Czech Republic in Friday's quarterfinals. Novak upset seventh seed Guillermo Canas of Argentina, 7-6 (8-6), 7-6 (7-1).
On the women's side, Daja Bedanova of the Czech Republic toppled Mauresmo, 6-2, 6-7 (6-8), 6-4. The 18-year-old held her nerve after failing to convert a match point in the second set and dropping her serve with a 5-3 lead in the final set. She broke Mauresmo's serve in the 10th game to close out the match.
In Friday's quarterfinals, Bedanova will take on No. 6 Silvia Farina Elia of Italy, who narrowly got past Iroda Tulyaganova of Uzbekistan, 7-5, 4-6, 7-6 (7-5).
Austria's Barbara Schett fended off four match points in the second-set tiebreaker to shock Wimbledon finalist Henin, 5-7, 7-6 (8-6), 6-2.
The 26-year-old Schett won the title here in her first two visits in 1994 and 1995. She captured her eighth career singles title in April at Budapest and also was a finalist in two other events.
Schett will encounter Russian wild card entrant Anastasia Myskina, who upset seventh-seeded Bulgarian Magdalena Maleeva, 6-4, 3-6, 6-4, to reach the round of eight.
Along with Mauresmo and Henin, No. 4 Nathalie Tauziat of France also had a first-round bye before saying a quick good-bye. The 1999 Kremlin Cup champion lost to Francesca Schiavone of Italy on Wednesday.
In other men's action, two-time champion Marc Rosset of Switzerland ousted No. 6 Fabrice Santoro of France, 6-2, 6-4. In the final eight, he will clash with Nicolas Kiefer of Germany, who disposed of Frenchman Jerome Golmard, 6-4, 6-3.
Kafelnikov, the top seed and four-time defending champion, defeated Argentine David Nalbandian, 6-3, 7-6 (7-4).
Kafelnikov runs into his fiercest adversary in the quarterfinals. Swede Thomas Johansson, who has won eight straight and nine of 13 career meetings with the Russian, advanced to the quarters with a win on Wednesday.
"I will be well prepared," Kafelnikov said. "I hope I can finally break through against him in my home tournament."
No. 4 Tommy Haas of Germany also reached the quarterfinals, beating Thomas Enqvist of Sweden, 7-5, 6-2. Haas will go up against another Swede, qualifier Magnus Gustafsson.
In other women's matches, Yugoslav Jelena Dokic, the fifth seed, cruised to a 6-4, 6-3 victory over Russian wild-card entrant Galina Fokinam. Dokic will take on Italian Francesca Schiavone in the quarterfinals.
No. 8 Elena Dementieva was the second Russian to make the women's quarterfinals. She rallied from a set down to beat American qualifier Alexandra Stevenson, 4-6, 7-5, 6-2.
Dementieva will encounter top seed and defending champion Martina Hingis of Switzerland.