Sunday's 7-5 7-5 victory at the Foro Italico put the Australian qualifier through to meet Denmark's Holger Rune, the No.7 seed, who beat Italian wildcard Fabio Fognini.
Popyrin, 23, had already beaten his compatriot Chris O'Connell and Canada's Felix Auger-Aliassime, the No.10 seed, in Rome.
Popyrin won the final three games to take the first set and broke serve decisively in the 11th game of the second set.
Although both sets were close, Popyrin served six aces and no double faults against Safiullin, ranked No.103, who had put out Seb Korda, the No.22 seed in the previous round.
Rune, meanwhile, kept his composure amid a partisan crowd and eliminated Fognini, the veteran Italian, 6-4 6-2.
Novak Djokovic had to raise his game after a mid-match lapse before beating Grigor Dimitrov 6-3 4-6 6-1.
Djokovic lost four consecutive games to hand the second set to Dimitrov, who won 12 straight points at one point as Djokovic struggled with his footwork, complained about the conditions of the clay on Campo Centrale and protested about several line calls.
But Djokovic raised his game when it counted most, broke Dimitrov in the opening game of the third, and improved to 11-1 in his career against the Bulgarian.
"I dropped my level a bit," Djokovic said. "But luckily I managed to find it right away in the first game, make that crucial break and kind of shape the momentum to my side.
"So I'm really pleased with the way I closed out the match."
Daniil Medvedev posted his first career win in Rome by beating Emil Ruusuvuori 6-4 6-2. The Russian had lost his opener in his previous three appearances.
Two-time defending women's champion Iga Swiatek swept aside Lesia Tsurenko 6-2 6-0 to extend her winning streak in Rome to 13 matches.
Having routed Anastasia Pavlyuchenkova 6-0 6-0 in her opening match after a bye in the first round, Swiatek has now dropped just two games over four sets.
If she raises the trophy again, Swiatek will join Chris Evert and Conchita Martinez as the third woman to win three consecutive titles in Rome.
The 2019 French Open finalist Marketa Vondrousova beat ninth-seeded Maria Sakkari 7-5 6-3.
Madison Keys advanced to the last 16 when Victoria Azarenka withdrew before their match due to a right leg injury.
With AP