INDIAN WELLS, Calif. -- Rafael Nadal defeated error-prone Roger Federer 6-4, 6-2 in the quarterfinals of the BNP Paribas Open on Thursday night in the earliest meeting between the two rivals since they first played each other in 2004.

Nadal needed barely 1½ hours to close out the defending champion in their 29th career meeting and the first in a quarterfinal. Nadal faced just two break points on his serve in the match.

Nadal and Federer usually don't play each other until the semifinals and finals of tournaments, but the Indian Wells draw pitted them against each other in their earliest meeting since a third-round match at Miami nine years ago.

Nadal returned to the ATP Tour a month ago, winning two of three tournaments on clay after missing seven months because of a left knee injury. He had his knee wrapped and at times appeared to have a slight limp.

"No question, he's a bit careful at times, his movement. That's totally normal," Federer said. "Hasn't played for some time on hard court. I don't know if it's careful or if it's just getting used to it again."

Federer, at 31 the oldest player left in the draw, tweaked his back earlier in the tournament.

"I'm happy to be out there and able to compete, but it's obviously a small issue," he said. "That doesn't work against guys like Rafa, obviously."

Nadal served a love game to even the first set 3-all, then earned the only break in the next game, taking a 4-3 lead on a backhand passing shot. He went on to win two of the final three games as Federer pulled shots wide or dumped them into the net.

"The longer the match went on, I realized I had to change up my game. I played differently than I was hoping to be able to," said Federer, who started attacking more with mixed results in the second set. "He got more comfortable as the match went on. Obviously, once I was down a set I knew it was going to be difficult."

Federer faced a slew of break points in the second set, with Nadal converting in two of the first three games to take a 3-0 lead.

Federer briefly rallied, gaining one break back at 3-1, then losing just one point on his serve in the next game to get to 3-2. But Nadal won the final three games to claim the match in front of Andre Agassi.

"You could see at least I could serve full basically, and that always gives you a direction," said Federer, adding that he didn't want to talk about his back too much "because I don't like to undermine his performance, either."

A year ago, Federer beat Nadal in the semifinals on his way to a fourth Indian Wells title. Nadal leads their career series 19-10, and evened their head-to-head mark on hard courts at 6-6. Nadal improved to 11-0 against top-10 opponents, with his last such loss coming here a year ago against Federer.

Nadal advanced to a semifinal against No. 6 Tomas Berdych, who beat Kevin Anderson 6-4, 6-4.

The women's draw was hit with the injury withdrawals of defending champion Victoria Azarenka and No. 7 seed Sam Stosur on Thursday.

Azarenka was scheduled to play No. 8 seed Caroline Wozniacki in a quarterfinal that would have pitted two former top-ranked players against each other. But she withdrew with a right ankle injury.

"It's already really painful, but it's very high risk to make it much worse," Azarenka said.

Stosur pulled out of her quarterfinal against No. 4 Angelique Kerber because of a right calf injury.

Wozniacki and Kerber moved into a semifinal against each other. No. 2 Maria Sharapova and No. 13 Maria Kirilenko will play in the other semi.

Azarenka had been in obvious pain during her earlier matches, but she downplayed it when asked. She said her ankle has been bothering her since before she played Serena Williams in a New York exhibition on March 5.

"It's just worse," she said. "I tried not to practice yesterday, and to see if it will settle down at least a little bit. I felt yesterday was better, not walking in my tennis shoes. But today, once I started doing the exercise, that was it."

Azarenka said a doctor advised her to rest because her ankle has inflammation and tendinitis in it. She added that she plans to travel to Key Biscayne, Fla., for next week's tournament.

"The doctor said it might heal quick, the pain might go down quickly because of the inflammation going down, but the healing process is a little bit unknown," she said. "So that's frustrating for me as a player, not knowing."

Stosur hurt her calf muscle in the last game of a three-set win against Mona Barthel on Tuesday. The Australian didn't practice on Wednesday and iced her leg. Stosur was five minutes into her warm-up on Thursday when she realized she couldn't play.

She said this is only the second time she's pulled out of a match in her career and isn't sure how long she'll be sidelined.