Updated

If anybody has Roger Federer's number, it is Juan Martín Del Potro.

Using his hard serve and booming forehand, Del Potro clinched the last spot in the semifinals on Saturday by overcoming the already qualified Federer 7-6 (3), 4-6, 6-3 in their final round-robin match.

Federer endured his second straight loss to Del Potro, who beat him in the final in the Swiss star's hometown tournament in Basel last month. It's the first time a player has beaten Federer in two straight indoor tournaments since Lleyton Hewitt in 2002.

"It's a little record, but really tough to do it," Del Potro said. "To beat Federer is not easy, for sure. But I didn't think about the semis or trying to qualify for the next round. Just was thinking about my match, doing the same things like in Basel."

Del Potro beat Federer in the 2009 U.S. Open final for his only Grand Slam title, leading many to predict that the tall Argentine would challenge for many more major titles. But much of the next season was lost because of a serious wrist injury, and he struggled to re-establish himself at the top.

o beat Federer is not easy, for sure. But I didn't think about the semis or trying to qualify for the next round. Just was thinking about my match, doing the same things like in Basel.

— Juan Martín Del Potro

This year, he wasted a two-set lead against Federer in the French Open quarterfinals and lost to him in the longest Olympic match ever, an epic semifinal that ended 19-17 in the third set.

"Good effort (from) his side to get me twice in a row now," Federer said. "I hoped I didn't have to lose against him again today."

It was Federer's first loss in the indoor tournament since 2009, ending a 12-match winning streak. He went undefeated in winning the last two titles and had won his first two group-stage matches this year.

Del Potro's win leaves David Ferrer and Janko Tipsarevic with nothing but prize money to play for in their final group-stage match, with both players already eliminated. However, that result will decide whether Federer or Del Potro finishes top of Group B and impact the semifinal matchups at the season-ending event.

The winner of the group will face Andy Murray on Sunday, while the second-place finisher has to take on top-ranked Novak Djokovic. The final is Monday.

"Now you have three big names in the semifinals, and one big guy," the 6-foot-6 Del Potro said.

Del Potro converted his only break point of the match in the opening game of the deciding set and then held his own serve comfortably to wrap up the win at London's O2 Arena.

He converted his first match point with a forehand passing shot that Federer could only return into the net with a lunging backhand volley.

Federer failed to convert three break points when leading 4-3 in the first set, and Del Potro held serve after a call on the same shot was overturned twice.

A backhand from Federer was called just wide by the line judge, only for chair umpire Lars Graff to declare that the ball was in. Del Potro then challenged Graff's correction, and a Hawk-Eye replay showed that the ball just missed the line.

Federer, who had never looked threatened on his serve, then committed a series of uncharacteristic mistakes in the tiebreaker as Del Potro won six straight points to take a 6-1 lead. He converted his third break point when Federer's backhand return sailed wide.

Federer broke the Argentine in the next game and lost just five points on his serve the rest of the way to tie the match.

But in the third set, it was Del Potro's turn to break in Federer's first service game, and the Swiss star couldn't muster another comeback.

Based on reporting by the Associated Press.

Follow us on twitter.com/foxnewslatino
Like us at facebook.com/foxnewslatino