GUANGZHOU, China - Roger Federer was eliminated from the ATP World Tour Finals on Saturday, losing to Nikolay Davydenko 6-2, 4-6, 7-5 in the semifinals.

Federer, who was broken three straight times in the first set, came within two points of winning while leading 5-4 in the third set. But Davydenko held on and then broke Federer to take a 6-5 lead before serving out the win.

"I was a couple of points away, but just couldn't get it done," said Federer, a four-time champion at the season-ending event. "He did well. I thought he played strong throughout, even though I don't think it was our best match we ever played against each other."

It was the Russian's first win over the top-ranked Federer in 13 matches.

"All my family, everybody who supports me, wait for this moment, when I can beat Federer," Davydenko said. "I was thinking it coming maybe 2010 or '11. But in 2009, end of the season, it's good feeling."

In the late match, U.S. Open champion Juan Martin del Potro will face Robin Soderling for a chance to play Davydenko in Sunday's final.

Federer again struggled with his serve and his shot-making for much of the match, but he looked invincible throughout the third set, losing only three points on serve to hold easily through 5-4. And with Davydenko serving to stay in the match, Federer took a 30-0 lead when he returned an overhead smash from Davydenko by running across the court and jumping high to get his racket on the ball.

Davydenko was stunned by the acrobatic return, but he still won the next four points to hold serve.

"I was thinking, Federer again lucky," Davydenko said. "I was thinking, not again, please."

Federer, who clinched the year-end No. 1 ranking after winning his second group match, again didn't look like himself at the O2 Arena, often misplacing his usual dominating forehand and sometimes struggling to hold serve against a player he had never before lost to.

Even the fans may have questioned who it was on the court when the scoreboard operator mistakenly put a red-white-and-blue-striped Russian flag next to Federer's name for a portion of the match. It was, however, quickly replaced by the familiar Swiss symbol of a white cross in a red background.

"Sure, it's disappointing. But not to lose against him, just to lose the semis," Federer said. "He finally beat me today. I wish him all the best for the final."

Federer lost the first set in each of his three Group A matches, but managed to beat Fernando Verdasco and Andy Murray before losing to Del Potro -- the same man who beat Federer in the U.S. Open final.

"You can't turn around every single match against top guys because then you don't have enough cushion anymore at the end," said Federer, who won the French Open this year to complete a career Grand Slam. "It's a game of luck at the end."

On Saturday, Federer was stellar in the opening two games, first holding at love with a pair of aces and then earning a pair of break points in the second game. But Davydenko saved them both, and he then went on his streak of breaking Federer three straight times. The 15-time Grand Slam champion broke back once.

"I picked sometimes wrong choice of shots, right from the start," Federer said. "After that, I didn't serve very well in the first set at all."

To start the second set, Federer slowed down his powerful serve, thereby raising his first-serve percentage, and held easily throughout.

However, he still showed his frustration early in the set. After sending backhand return into the base of the net, the ball came bouncing back toward him and he kicked it over to the other side of the court. That, too, went wide.

But leading 5-4 in that second set, he managed to break Davydenko for the second time when the Russian sent a forehand wide on Federer's second break point.

Davydenko came into the match on Saturday afternoon after playing well into the night the day before, when he needed three sets to beat Soderling. He said he didn't get to bed until 3 a.m. and slept for only seven hours ahead of Saturday's match.

"But feeling OK really," the Russian said. "Seven hours was enough."

Earlier at the tournament, the 2008 runner-up lost to Novak Djokovic in his opening Group B match but then beat second-ranked Rafael Nadal.

"I don't think, 'Now I'm No.1,' because I beat Federer," Davydenko said. "But I know now in confidence, if I beat everyone then I can play very well."