After taking the first point to lead 15-0 on his serve, Shapovalov dropped the next three and faced two game points.
Shapovalov, who will facew Nadal on Thursday, finished with seven aces and converted three of 11 break point opportunities in a match that lasted two hours 26 minutes.
"We're finally connecting and I think that's the most lovely thing", Fognini said of the crowd, which whistled him off the court following an erratic performance a few years ago. Nadal, also attempting to win the top spot back this week, will replace Roger Federer if he wins an eighth Rome title.
The 19-year-old Shapovalov stunned Nadal in the third round in Montreal last year to deny the Spanish player a chance to regain the No. 1 spot. Dimitrov has now lost four consecutive matches in Rome, dating back to his first-round win over Poland's Jerzy Janowicz in 2015.The Japanese star, a Rome semi-finalist in 2016 (l.to Djokovic) will meet Philipp Kohlschreiber for a place in the quarterfinals.
"I played very well today", said Thiem.
Fognini eased past Germany's Peter Gojowczyk 6-4, 6-4.
Also, ninth-seeded David Goffin was leading 6-2, 4-5 when Juan Martin del Potro retired because of a groin injury; and 10th-seeded Pablo Carreno Busta beat Aljaz Bedene 6-4, 6-7 (3), 6-2.
The 22-year-old Kontaveit won through 6-2, 7-6 (7/3) against the 37-year-old American who was seeded eighth in a tournament she won almost two decades ago to 1999.
Russian Federation favored Trump in 2016, Senate panel says
Former FBI director James Comey had also been invited to testify about the findings to the panel but did not attend. In another email, Goldstone referred to Veselnitskaya as "the Russian government attorney".
In the women's tournament, Simona Halep's hold on the No. 1 ranking received a boost when American Madison Keys withdrew from their last-16 match due to a rib injury.
Halep needed to reach at least the last eight and go further than world number two Caroline Wozniacki to retain the top-ranking going into the French Open.
Williams had earlier opened her campaign by brushing aside Russia's Elena Vesnina 6-2, 4-6, 7-5 in their last-32 clash.
Svitolina overcame a poor start to beat 14th-seeded Daria Kasatkina 0-6, 6-3, 6-2.
Defending champion Alexander Zverev beat Italian wild-card entry Matteo Berrettini 7-5, 6-2.
Djokovic, a four-time victor, is on the comeback trail three months after elbow surgery and eased past Georgia's Nikoloz Basilashvili 6-4, 6-2.
He has French Open 10 out of 12 times in his career and surely he is the favourite this year as well.
Former world number one Karolina Pliskova took centre stage for smashing the umpire's chair with her racket instead of shaking hands after losing to Greece's Maria Sakkari after an incorrect line call.