British number one Cameron Norrie beat Marton Fucsovics to set up an Italian Open last-16 meeting with world number one Novak Djokovic.
Norrie came through 6-2 7-6 (7-4) in a match that had been held over following Saturday's rain interruptions in Rome.
Norrie had led by a set and 5-1 but was pegged back by the Hungarian before digging deep again to win.
Djokovic overcame Grigor Dimitrov 6-3 4-6 6-1 after seeing a 4-2 second-set lead disappear.
World number one Iga Swiatek eased into the last 16 in the women's event but sixth seed Coco Gauff was beaten.
Thirteenth-seed Norrie looked strong from the start against his opponent, ranked 92nd in the world, and broke for an early 3-1 advantage and built on that, breaking again in the eighth game.
As the match went on, Fucsovics struggled on his serve and Norrie twice took advantage to go 5-1 up and within sight of victory.
However, out of nowhere the British number one started to struggle as the Hungarian staged a mini revival, twice breaking Norrie as he served for the match and saving five match points - four on his own serve - on his way to levelling it at 5-5.
Norrie held his nerve to go 6-5 up but his opponent levelled again to force the tie-break.
Despite losing the first two points then going 3-1 down, Norrie started to show the aggression that had been lacking in the latter part of the set. He seemed to find another gear and went 6-3 up before winning on his seventh match point.
Djokovic recovered well from his second-set struggle which saw Dimitrov win four games in a row before he raised his level again in the decider.
But the Serb was critical of the condition of the centre court surface at the Foro Italico.
"What is interesting would be to understand how much tennis they're playing on the court actually before the tournament starts," he said.
"If you don't use the court, and you have a clay court, the court breaks. You have many holes. You have an uneven surface, really bad bounces, a lot of clay. In Rome, it has been happening for quite a few years.
"Now there's really not much you can do. It's just kind of covering the holes here and there. Hopefully as the days pass and the tournament progresses, the court will get better."
Swiatek, who is bidding for her third straight Rome title, breezed into the last 16 of the women's draw with a 6-2 6-0 win over Ukraine's Lesia Tsurenko.
The Pole lost the first two games but then showed her dominance by rattling off 12 in a row.
Gauff's defeat and the elimination of world number eight Maria Sakkari means six of the world's top 10 women are out of the tournament.
World number five Gauff was defeated by Marie Bouzkova of the Czech Republic 4-6 6-2 6-2 while Marketa Vondrousova beat Sakkari 7-5, 6-3.
And former world number one Victoria Azarenka withdrew with a right leg injury meaning Madison Keys of the United States advanced into the last 16.