Meeting as early as the quarterfinals is a rarity for two of the game's all-time great players. Nadal slipped to No. 5 in the world during his injury-caused absence last year and was placed in the same quarter of the draw as Federer for this Masters series event.
Nadal escaped with a 4-6, 6-4, 7-5 win over Ernests Gulbis Wednesday and Federer fought off Stanislas Wawrinka 6-3, 6-7 (4-7) 7-5.
Nadal holds an 18-11 advantage over Federer. They have not met since this tournament last year, when Federer won in the semifinals.
World No. 1 Novak Djokovic kept his 2013 record perfect with a 6-0, 7-6 (8-6) win over Sam Querrey. Djokovic controlled the first set, losing only four points on serve. Querrey managed a break in the second set but Djokovic prevailed in the tiebreaker.
Jo-Wilfried Tsonga also made it to the quarterfinals with a 4-6, 7-5, 6-4 decision over Milos Raonic. Tsonga will face Djokovic in the quarterfinals.