LONDON — In his ATP Finals debut, Jack Sock joined Roger Federer in the semifinals.

Sock, the first American to reach the final weekend at the season-ending tournament since Andy Roddick in 2007, beat Alexander Zverev 6-4, 1-6, 6-4 to advance from his round-robin group on Thursday.

"I didn't expect to be in London in the first place," said Sock, who qualified only this month after winning the Paris Masters. "Paris was a big step for me. Now to put myself in the position to play on the weekend is another big step forward, another confidence-booster."

Sock again played an entertaining match at the O2 Arena, complete with another 'tweener and even a point penalty for smashing a ball into the crowd.

But it was a pair of errors from Zverev in the final game that gave Sock the match. Trailing 5-4 and at 30-all, Zverev double-faulted for the eighth time to hand Sock a match point. The 20-year-old German then put a forehand wide to end it.

"Yeah, I choked," Zverev said. "It's quite easy. Won the second set 6-1. I was 1-0 with a break. He got a point penalty. I was down 1-4 within 10 minutes where I didn't put many balls in the court."

Sock finished the group stage with a 2-1 record and will next face Grigor Dimitrov in the semifinals on Saturday. His only loss came against Federer in his opening match.

Federer ended up 3-0 and won the group. He will face Dominic Thiem or David Goffin on Saturday.

In a rematch of the Wimbledon final against Marin Cilic earlier, Federer came out on top again. The second-ranked Swiss lost the first set but still won 6-7 (5), 6-4, 6-1.

"It wasn't easy," Federer said. "I mean, look, it's a fast court. It's indoors. We've seen it now: When you miss a few too many opportunities you can really pay the price at this tournament."

The outcome didn't really matter, though. Federer had already advanced while Cilic had already been eliminated.

Federer, who beat Cilic in straight sets in the Wimbledon final in July, had four break points in the first set on Thursday, but he couldn't convert any of them. Cilic closed it out in a tiebreaker.

Federer had another break point early in the second set, but he again failed to convert. But his sixth attempt was different, and winning it gave Federer the second set.

In the third set, Federer broke early and jumped out to 3-0, and then broke again to lead 5-1.

"In the beginning I was slightly overaggressive in the first set on some crucial points rather than maybe being patient," Federer said. "I was able to turn that around late in the second set. Then just had a much better feeling in the third set."

Cilic is ranked No. 5 in the world — achieving a goal he set for himself at the end of last season.

At the ATP Finals, however, the Croat has won only once in nine matches over three appearances at the round-robin tournament.

"Overall, I felt that my level has come to a new level," the 2014 U.S. Open champion said of his 2017 season. "So hopefully even more next year, I can aim a little bit higher. Hopefully I'm going to be in a position to challenge the top guys and to be in contention for Grand Slams."

Federer, the 19-time Grand Slam champion who won his record eighth Wimbledon title, is looking to extend another record for titles at the ATP Finals. The 36-year-old Swiss has won it six times — twice in Houston, twice in Shanghai and twice in London.

Federer has reached the semifinals at the ATP Finals 14 times and has finished the round-robin stage unbeaten 10 times.

Regardless of the outcome in London, Federer will finish the year ranked No. 2 — behind Rafael Nadal.

"I'm so happy that I was able to reach this level of play and still be able to play also at the end of the year," said Federer, who also won the Australian Open this season. "I have no regrets because I totally over-exceeded my expectations. Just happy I'm injury-free and healthy right now, enjoying myself still."

___

More AP tennis coverage: https://apnews.com/tag/apf-Tennis

___

This story has been corrected to show Zverev double-faulted eight times, not seven.