(ALASTAIR GRANT ~ Associated Press)
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 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."
(AP Photo/Alastair Grant)
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.
"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 him 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, 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."
Del Potro dominated with his service game, winning 77 percent of the points on his first serve and 64 percent on his second. He was broken only once, while he broke Soderling twice.
"We played unbelievable points. We served well," Del Potro said. "The difference was just a couple of points in the tiebreak on the second set."
The Argentine lost his opening round-robin match, but has won three straight since then, including a three-set win over Federer on Thursday.
Soderling, who reached the French Open final this year but lost to Federer, said Del Potro did better when it counted.
"Maybe I could have played a little bit better in the important moments and take advantage of my chances," said Soderling, who beat Nadal and Djokovic in his opening two matches. "I don't think I did anything wrong at the end of the match."