WATCH the ATP Tour LIVE on beIN SPORTS | available via Foxtel, Kayo Sports, Fetch TV & beIN SPORTS CONNECT
Rising star Sinner gave Nadal a stern test, but the veteran emerged triumphant with a 7-5 6-4 triumph in two hours and 12 minutes.
Nadal will face Denis Shapovalov – who also beat an Italian in the shape of Stefano Travaglia – in the last 16.
The hard-fought victory is a welcome one for Nadal after he lost to Alexander Zverev in the Madrid Open quarter-finals last time out.
However, there was a big star who fell with world number two Medvedev, who continues to struggle on clay, eliminated by his compatriot Aslan Karatsev.
Karatsev impressively triumphed 6-2 6-4 in 78 minutes, winning 26 of his 29 first-serve points and not being broken in the match.
"I'm super happy," said Karatsev, who also beat world number one Novak Djokovic last month and will face Reilly Opelka next.
"It was a really tough match. Against Medvedev you never know, he's a big server. It's tough to return, but I managed it well."
Dominic Thiem almost went the same way as Medvedev, coming within two points of going out in his first match in Rome, which has also happened in his previous two appearances.
However, the Austrian battled back to defeat Marton Fucsovics 3-6 7-6 (7-5) 6-0 in a match lasting two hours and 33 minutes, booking a last-16 clash with Lorenzo Sonego.
"It was such a close match, especially in the second set,” said Thiem, a semi-finalist in Madrid last week.
"I knew he'd be a super-tough opponent, particularly coming from different conditions in Madrid. I was fighting all the match and stayed in there.
"At the end, I got the reward for fighting. I had difficulties with my timing and my serve.
"I have to hurt my opponent more with my shots. I still won a great match and I will try to improve."
There were smoother victories for Madrid champion Zverev and Stefanos Tsitsipas.
Zverev cruised past qualifier Hugo Dellien in a 6-2 6-2 success, while Tsitsipas saw off Marin Cilic 7-5 6-2.
Andrey Rublev defeated Jan-Lennard Struff in three sets, while Matteo Berrettini also progressed, beating John Millman in straight sets to book a clash with Tsitsipas which looks like the pick of the last-16 draw.