LONDON — Rafael Nadal and Andy Murray relentlessly ran each other all over the court for more than three hours in a match that flip-flopped throughout.

LONDON — Rafael Nadal and Andy Murray relentlessly ran each other all over the court for more than three hours in a match that flip-flopped throughout.

Nadal finally got the breaks he needed Saturday to win 7-6 (5), 3-6, 7-6 (6). The top-ranked Spaniard had to overcome a mid-match slump to reach his first final at the ATP World Tour Finals, where he will face 16-time major champion Roger Federer.

"(It) was (an) incredible tennis match," said Nadal, who won this year's U.S. Open to complete a career Grand Slam. "(This) was a really difficult match against one of the best players of the world."

The reigning French Open, Wimbledon and U.S. Open champion has never before played in the final of the season-ending event for the top eight players. And to win his first title, he'll have to play four-time champion Federer today at the O2 Arena.

Federer beat Novak Djokovic 6-1, 6-4 in the other semifinal.

"Obviously I'm really looking forward to playing against Rafa tomorrow," Federer said. "Who wouldn't?"

In the early match, both Nadal and Murray looked strong throughout the first set, which the Spaniard won in a tiebreaker despite a late surge from Murray. But Nadal started to falter after holding serve to lead 3-2 in the second. Murray won 17 of the next 23 points — and four straight games — to take the set and even the score.

Nadal never fully regained his form after the mid-match slump, but he was able to break Murray to take a 2-1 lead in the third set. The Spaniard then had his first match point on Murray's serve while leading 5-3, but the fifth-ranked Briton managed to hold the game, break back to 5-5 and force the final tiebreaker.

In the tiebreaker, Murray won the first three points — two of them on Nadal's serve — and looked as though he was going to roll to victory. But Nadal clawed back to 4-4 before getting another match point at 6-5.

Murray again saved that one, but he couldn't do anything about the final match point, which Nadal won with an inside-out forehand.

Federer looked as dominating as ever against Djokovic, stretching his career record against the Serb to 13-6.

The second-ranked Swiss jumped out to a 3-0 lead in the first set, then broke Djokovic again to make it 5-1. But Djokovic responded early in the second set, breaking Federer to give himself a 3-0 lead.

That didn't last long, however, as Federer held serve, broke back and then held again to 3-3.

Federer's run lasted another three points, but he wasted all three break points in the seventh game, allowing Djokovic to take a 4-3 lead on serve.

After holding, Federer broke again and then served out the match.

"He was on top of his game," said Djokovic, who beat Federer in the U.S. Open semifinals. "He was playing unbelievable from the first moment. He deserved to win."

Murray finished his match with 22 aces, but he also had 47 unforced errors to go along with his 53 winners. Overall, the Briton won 114 points in the match, five more than Nadal.

"It was one of those matches where you kind of knew — so many long rallies, so many good points — I kind of knew when I was out there that it was a great match," Murray said. "It's nice in some ways to be involved in matches like that. But it's not nice losing them."