Roger Federer and Rafael Nadal will square off in the quarterfinals after both survived fourth-round tussles on Wednesday at the $4.33 million BNP Paribas Open.

Federer outlasted Swiss countryman Stanislas Wawrinka by a 6-3, 6-7(4), 7-5 margin on the hardcourts at the Indian Wells Tennis Garden.

Meanwhile, Nadal edged Ernests Gulbis 4-6, 6-4, 7-5 to set up the blockbuster match with Federer. The French Open champ Nadal was the Indian Wells winner in 2007 and 2009 and runner-up in 2011.

Nadal and Federer will meet for the first time in 12 months. Nadal leads their career series by an 18-10 margin.

The Wimbledon titlist Federer is the reigning champion and a four-time winner here. He is chasing his first title of the season.

Late Wednesday, top-seeded Novak Djokovic advanced with a 6-0, 7-6 (8-6) win over American Sam Querrey and will face eighth-seeded Frenchman Jo-Wilfried Tsonga in the quarterfinals. Tsonga came back to beat 17th-seeded Canadian Milos Raonic, 4-6, 7-5, 6-4. Raonic, who recently titled in San Jose, bowed out Wednesday with a match-ending double fault.

Andy Murray, the No. 3 seed, beat Carlos Berlocq, 7-6 (7-4), 6-4, and will next face seventh-seeded Juan Martin del Potro, who overpowered German Tommy Haas, 6-1 6-2.

The U.S. Open champion Murray was the Indian Wells runner-up in 2009.

Meanwhile, sixth-seeded Czech Tomas Berdych handled Frenchman Richard Gasquet, 6-1 7-5, and will take on South African slugger Kevin Anderson, who upended 13th-seeded Frenchman Gilles Simon, 6-3, 1-6, 6-4.

The 2013 Indian Wells champ will collect $1 million.