Roger Federer blew a commanding lead to lose 4-6 7-6 (7-2) 7-6 (7-4) against Richard Gasquet at the Rome Masters.
The world number three, 29, had won his previous eight matches against Gasquet but saw that run end with an error-strewn display in the third round.
"I should never have lost," said Federer. "He knows how close he came to losing. I had multiple chances."
Novak Djokovic recorded his 36th successive victory while world number one Rafael Nadal also progressed.
Serbian Djokovic made light work of Stanislas Wawrinka, despatching the Swiss player 6-4 6-1 in a little over 90 minutes to wrap up his 34th win since the start of the year.
World number one Nadal shrugged off a fever to produce an improved display as he defeated fellow Spaniard Feliciano Lopez 6-4 6-2.
Nadal had struggled in round two against Paolo Lorenzi, a player ranked 148 in the world, and after beating Lopez he explained: "I had a fever [on Wednesday evening] and [on Thursday morning] I didn't feel better.
"I didn't know if I was going to go on the court for the match. I decided at the last moment."
The match was delayed for 20 minutes while Nadal deliberated, and he added: "I didn't understand why I felt so slow [on Wednesday], why I had no energy. I understand today."
Nadal began his third-round match brilliantly, breaking Lopez's serve to go 2-0 up and taking his fellow Spaniard to deuce in his next service game.
A blip came in the seventh game when errors cost Nadal and he was broken, but the world number one broke back in the 10th game to take the first set.
Nadal repeated the feat in the sixth game of the second set and had two match points on Lopez's serve in the eighth, taking the second when his opponent hit a wayward volley.
If Djokovic wins the title and Nadal fails to beat Marin Cilic, who saw off Mardy Fish 7-6 (8-6) 6-3, in the quarter-finals, then the Serbian will take the world number one spot from the Spaniard.
Djokovic next faces fifth seed Robin Soderling, who held on to beat ninth seed Nicolas Almagro 6-3 3-6 6-4.
However, Federer's hopes of spending more time on the clay courts ahead of the French Open, which starts on 22 May, were dashed by Gasquet, who came from a set down to beat the Swiss for the first time since 2005.
The Frenchman lost the first 10 points of the match, but hit back to win the next 10 as they shared the first six games.
But Federer made the crucial break in game seven and when he broke again in game five of the second set, a straightforward victory looked likely.
However, Gasquet broke back and took the set to a tie-break which he won with a service winner.
The final set also went to a tie-break and this time Federer missed the line with a forehand to set up match point before sending a backhand long to gift Gasquet the win.
"I had a lot of good chances at a set, 4-3 and serving and then at 4-4 and 15-40 [on Gasquet's serve]," said Federer.
"It was tough to play out there, it was a slippery court. Richard started to play better as the match went on. In particular he was serving better, my level went down and Richard made it worse.
"It was tough, I never felt I was probably going to win the [third set] breaker. It's not fun to play that way."
Gasquet's reward is a last-eight match against seventh seed Tomas Berdych, who held off Finnish qualifier Jarkko Nieminen 6-2 6-7 (4-7) 6-2.
In the women's event, top seed Caroline Wozniacki of Denmark beat Belgium's Yanina Wickmayer 6-1 7-6 (7-4) to make it through to the last eight.
Wozniacki next faces Serbian fifth seed Jelena Jankovic, who beat Anabel Medina Garrigues of Spain 6-4 2-6 6-2.
They are joined by Italian second seed Francesca Schiavone, who was taken to three sets by Slovakia's Daniela Hantuchova but emerged victorious via a 3-6 6-2 7-5 scoreline.
"Winning a battle gives you a lot of satisfaction. I'm happy because I didn't play that well, but sometimes in tennis it's better winning that way," said Schiavone, who next plays the woman she defeated in last year's French Open final, Australian sixth seed Samantha Stosur, a 6-3 6-4 winner against Polona Hercog.
Also into the last eight are fourth-seed Li Na of China, who defeated Jarmila Gajdosova 6-2 6-1 and will next play Hungarian Greta Arn, who overcame Russian Elena Vesnina 3-6 7-6 (7-3) 7-6 (7-3).
Russian seventh seed Maria Sharapova brushed aside the challenge of Israeli 10th seed Shahar Peer 6-2 6-2 and next faces third seed Victoria Azarenka of Belarus, who defeated Russia's Anastasia Pavlyuchenkova 6-4 4-6 6-2.