Nadal, beaten in the third round on the blue clay in Madrid, looked delighted to be back on the red stuff as he eased past his German opponent.
The second seed was too much for Mayer to handle in the first set, with a double-break comfortably securing the opener for Nadal.
The German player showed a marked improvement in the second, but his otherwise-impressive serve was finally broken in the 11th game of the set before the Spaniard came from two points down to hold for the match.
Mayer beat Nadal the last time they played, in Shanghai last year, but on his favoured clay, the Spaniard never allowed him to really get a foothold in the match.
"Today it was an important first set and I played aggressive," said Nadal. "I made a mistake in the first set and then I felt good in the forehand.
"It is difficult to play against Mayer because he knows how to put you in a difficult position in the game, but I didn't suffer I think."
"You have to be careful when you win and when you lose and with anyone you are playing," added Nadal. "I will respect my opponent and when you play a Masters 1000. Marcel is one of my best friends on tour – it is a great victory for him."
Youzhny did well to stay with the resurgent world number nine in the first set but was blown away by his power in the second.
Del Potro next plays Jo-Wilfried Tsonga in a mouth-watering third round clash.
Guillermo Garcia-Lopez, a Spanish qualifier, suffered an astonishing third-set collapse to lose 6-4 2-6 6-4 to 11th seed Gilles Simon.
Clay specialist Garcia-Lopez was leading 4-0 in the decider before losing six games in a row to allow the Frenchman to progress. He plays David Ferrer next.
World number 30 Seppi hit 43 winners as he started shakily before bullying the big American, sparking football-type celebrations from his fans.
Other completed matches in Rome on Wednesday saw 14th-seeded Argentine Juan Monaco overcame Czech veteran Radek Stepanek 6-4 6-2 to set up a meeting with world number one Novak Djokovic in the last 16.
- Related links