Updated

Rafael Nadal outlasted David Nalbandian 4-6, 7-5, 6-4 in the BNP Paribas Open on Friday, setting up a semifinal against Roger Federer that will be a rematch of their Australian Open semifinal.

Federer had an easier time in his quarterfinal, beating Juan Martin del Potro 6-3, 6-2 in just more than an hour for his fourth victory over the Argentine this year.

Top-ranked Victoria Azarenka defeated Angelique Kerber of Germany 6-4, 6-3 to reach the final of her sixth consecutive tournament. It was her 22nd straight victory, giving Azarenka the best start to a season since Martina Hingis began 37-0 in 1997.

The second set was littered with service breaks, with Azarenka breaking four times and Kerber twice.

"It's a little bit difficult with the wind, especially from one side," Azarenka said. "She was really playing, putting a lot of pressure, and it was difficult to control the ball a little bit. Overall, I played pretty good on the return."

Second-ranked Maria Sharapova advanced to the final when Ana Ivanovic retired with a left hip injury after losing the first set 6-4 and leading 1-0 in the second in their first meeting since the 2008 Australian Open final, won by Sharapova.

"I am happy after a long match yesterday that I got a little shorter one," Sharapova said.

Azarenka beat Sharapova in this year's Aussie Open final. Their rematch Sunday will be the first final between the world's top two women since 2008.

"I would love to get my revenge," Sharapova said.

Ivanovic left the court with a trainer trailing 5-4 in the first set.

"After the treatment, it was just getting worse and worse rapidly," she said. "We taped it and then I tried to continue, but at the end, I couldn't even return. I couldn't even stand there on my return."

Sharapova practiced her serves during the eight-minute delay on a cool, windy evening in the desert. Ivanovic returned and held to open the second set, but then quit.

"I hope it's nothing that's going to put me away from the court for too long so I can start straight back into it because I feel physically very good," Ivanovic said. "I really felt like I have been playing the best tennis probably played in a very, very long time. Against top players I can bring that level. That's what's very encouraging."

Nadal, ranked second in the world, handed No. 3 Federer one of his two losses since last year's U.S. Open when he beat the Swiss star in the Australian Open semifinals in January. They will play Saturday, when rain and wind is forecast to move into the Coachella Valley, spoiling the sun and 80-degree temperatures that have prevailed during the two-week tournament.

"I play always against Roger means a little bit more than against the rest of the opponents because I am playing probably against the best of the history," Nadal said, "so that's why it makes the match a little bit more special than the rest."

Federer improved to 37-2 with five titles since the U.S. Open. His other loss came in Davis Cup against American John Isner, who advanced to the other semifinal against top-ranked Novak Djokovic.

Despite all his success, Nadal said he routinely has doubts about whether he can win matches and that only arrogant people don't doubt themselves.

"I believe that it's going to be a very difficult match for me, and I don't know if I'm going to be able to play my best," he said. "But that's part of the game, and that's the beautiful things about the sport. I'm going to go there, I'm going to fight every ball and try to play my best tennis and I hope that's going to happen, but I don't know."

Nadal hadn't lost a set coming into the quarterfinals, but Nalbandian spoiled that right away. The Argentine was full of confidence, having earlier taken out Janko Tipsarevic and Jo-Wilfried Tsonga — his first time beating two top-10 players at the same event since 2008. Nalbandian won the final three games to take the opening set.

The Argentine led 4-3 and 5-4 in the second before Nadal reeled off the final three games to take the set, breaking Nalbandian in the 11th game on a double fault.

Nadal broke three times in the final set, including at love to go up 5-2. Nadal served two love games and served and volleyed with success at times.

"I hit fantastic volleys," he said.

Nadal had his first match point in the ninth game, but three consecutive errors helped Nalbandian close to 5-4.

Nadal faced two break points in the next game — the first when he netted an easy smash after being run all over the court. He saved the second after Nalbandian missed a drop shot, then smashed his racket and yelled. Nalbandian tossed his racket after netting a forehand to give Nadal his second match point. The Spaniard closed it out after Nalbandian's backhand off Nadal's drop shot went wide.

The first game between Federer and Del Potro lasted 11 minutes. One of Federer's first serves was called good by a line judge, although both he and Del Potro believed it was out. Del Potro wanted to challenge, but the Hawk Eye line calling system temporarily broke down when an Internet connection was lost and data couldn't be provided.

As a result, the chair umpire supported the line judge's original call and Federer held on his way to building a 3-0 lead, including the set's only service break. Del Potro, who had two break points in the first game, argued to no avail.

"It was clear out and the machine doesn't work," he said. "But then the chair umpire told me he made a mistake ... could be a big chance to me to change the way of the match in that game. After that I was not concentrating."

He broke Del Potro twice in the second set when he led 5-1. Del Potro netted a return of Federer's second serve on the Swiss' second match point.