MADRID (AP) – Roger Federer will face Rafael Nadal for a championship.

On clay. In Spain.

The two rivals set up their first clash since the Australian Open when Nadal saved three match points to beat Novak Djokovic 3-6, 7-6 (5), 7-6 (9) on Saturday.

Playing their fourth match this year, they needed a Masters Series record 4 hours, 3 minutes to decide matters at the Magic Box tennis center. Federer beat Juan Martin del Potro 6-3, 6-4 in their semifinal.

Top-ranked Nadal’s 33rd straight win on clay lifted him into his seventh final this season, but he will be nursing a right knee injury into Sunday’s match.

Federer has lost his last five matches against Nadal, including the finals at the French Open, Wimbledon and Australia in February, when the Swiss player was in tears after the defeat.

“What’s important for me is to get past that semifinal hurdle that I haven’t been able to get past in the last couple of months,” Federer said ahead of their 16th meeting in a final. “I feel like playing him anywhere is a challenge. The extra flair here is that it’s in Spain.”

Earlier, top-ranked Dinara Safina beat Patty Schnyder 6-4, 6-2 to set up a final against teenager Caroline Wozniacki, who put away former No. 1 Amelie Mauresmo 7-6 (1), 6-3.

Nadal, who won in the Spanish capital in 2005 when the event was played on indoor hard court, is 9-1 on clay against Federer, who didn’t doubt Nadal would be in top shape for the pairs first match in Spain.

“They asked me the same question in Australia,” said Federer, who faced Nadal after he had won a grueling five-set match against Fernando Verdasco. “I think with the adrenaline and the crowd he’s going to be the Rafa we know tomorrow.”

It’s the mental aspect that Federer will have to prepare for as he comes face-to-face with Nadal for the first time since the Spaniard denied him a chance to equal Pete Sampras’ record of 14 Grand Slam wins.

Djokovic was also left red-eyed after feeling in control for most of Saturday’s match.

“It’s frustrating when you play so well and you can’t win,” No. 4-ranked Djokovic said.

Nadal complained of discomfort in his right knee before the match, which hampered his ability to move as he made uncharacteristic errors that allowed for an early break in the first set.

Nadal had his leg wrapped in the second set before leveling.

In the deciding tiebreaker, Djokovic watched Nadal hit forehand winners down the near line to save his first two match points. The Serb then beat Nadal with a passing shot to save a match point of his own.

But leading 9-8, Djokovic sent the ball out and then netted on Nadal’s next match point to end the longest three-set match in the history of Masters tournaments, the ATP level below the Grand Slams.

“I love these matches, it’s very special to play these matches,” said Nadal, who improved to 27-1 in clay semifinals. “If I don’t fight here, when am I going to fight?”

Despite 50 unforced errors against Djokovic, Nadal’s perseverance paid off as he rallied the 12,500 spectators with crucial winners to reach his 26th clay-court final. He has won 25 of those.

Djokovic, who missed a chance to take the No. 3 ranking from Andy Murray, added his latest loss to Nadal to those recently in the Olympics, the Davis Cup, and finals at Monte Carlo and Rome.

“I played one of my best on this surface, so … I don’t think you need my comments, you saw everything,” Djokovic said. “A couple of points decided the winner.”

Federer improved to 5-0 against del Potro, who has yet to take a set off the former No. 1. He will be going for his 15th Masters title – and first in nearly two years – which would allow him to equal the 22-year-old Nadal’s tally. Only Andre Agassi has won more with 17.

Safina, coming off a victory at Rome, reached her fifth final of the season by staying undefeated in four meetings against Schnyder.

Wozniacki, who hasn’t dropped a set this week to reach her third final of the season, saved two set points before rallying to take the first and then clinched it on her second match point when Mauresmo hit long.

Only subscribers are eligible to post comments. Please subscribe or to participate in the conversation. Here’s why.

Use the form below to reset your password. When you've submitted your account email, we will send an email with a reset code.