Top-ranked Nadal moved closer to clinching the season-ending No. 1 ranking by beating Richard Gasquet 6-4, 6-2, while second-ranked Federer eased past Australian Open finalist Jo-Wilfried Tsonga 6-4, 6-1.
Nadal, the 2005 champ who needs to return to the final to retain the year-end top spot, set up an all-Spanish matchup with Feliciano Lopez, who beat Stanislas Wawrinka of Switzerland 6-4, 6-4.
Federer, winner of Madrid the year after Nadal, will face Juan Martin del Potro, who eliminated defending champion and fellow Argentine David Nalbandian 6-4, 6-2.
Also, fourth-seeded Andy Murray edged Marin Cilic of Croatia 7-5, 7-6 (2) while eighth-seeded Andy Roddick lost to Gael Monfils of France 6-4, 3-6, 6-3.
Nadal dominated his French opponent, hitting one passing winner after another as Gasquet came to the net all match. Nadal noted afterward that a right leg injury was much better.
"I played a good match and I am leaving happy with my game, but it's true that he has made more unforced errors than usual, especially with his backhand,'' Nadal said.
In a first career matchup with Federer expected to produce lots of sting, Tsonga seemed to lose steam from the end of the first set when the Frenchman nicknamed "Ali'' because of his uncanny resemblance to former boxer Muhammed Ali double-faulted.
Federer had few problems from there on out and scored two breaks in the second set to complete the quick win.
"I tried to put him under pressure there, the conditions allow you to do that,'' Federer said. "At this stage you're looking for the knockout punch, like in boxing.''
The ninth-ranked del Potro controlled the third-round match from the start after breaking Davis Cup teammate Nalbandian in the first game.
"I have to do my things, but in Davis Cup he is the leader and he is the one that counts above everyone else,'' said del Potro, who was closing in on a spot at next month's Masters Cup in Shanghai. "We don't compete to see who is the best from Argentina.''
Nalbandian, who won the Stockholm Open last week, and del Potro will play singles for Argentina in the Davis Cup final against Spain to close the season next month.
U.S. Open finalist Murray broke Cilic twice in the last three games to take the first set.
Cilic rallied late in the next set to force a tiebreaker, but Murray took a 6-1 lead after Cilic double-faulted. Murray clinched the match when Cilic hit a shot long.
"I hit some great shots to break him,'' Murray said. "I was getting chances on his service games. I found a way to get through.''
Gilles Simon of France, who saved four match points to beat Igor Andreev in the first round, saved two more in beating Robby Ginepri of the United States 6-7 (6), 6-4, 7-6 (6). Simon will play either Australian Open champion Novak Djokovic or Ivo Karlovic of Croatia.
Usain Bolt Is A Blanco
Del Potro knocks Nalbandian out at Madrid