LONDON — Defending champion Alexander Zverev secured the last semifinal spot at the ATP Finals on Friday, eliminating Rafael Nadal in the process.

Zverev beat already eliminated Daniil Medvedev 6-4, 7-6 (4) at the O2 Arena to finish second behind Stefanos Tsitsipas in the group and set up a semifinal against Dominic Thiem.

Earlier, Nadal stayed in contention by rallying to beat Tsitsipas 6-7 (4), 6-4, 7-5 for his second win of the round-robin stage.

But Zverev’s win left him, Nadal, and Tsitispas with identical 2-1 records — with the top-ranked Spaniard eliminated based on the tournament’s tiebreaker rules.

It means only one of tennis’ Big Three made the semifinals as Novak Djokovic was also eliminated on Thursday. Tsitsipas will face six-time champion Roger Federer in the first semifinal on Saturday.

“The young guys have been playing much better tennis than they were maybe last year," Zverev said. “Nobody expected (Nadal) to be out from our group. Our group was very, very difficult, and for me and Stefanos to qualify, I don’t think a lot of people would have picked (that).”

Medvedev (0-3) had only pride to play for against Zverev and was broken in the opening game. The Russian largely held his own after that but couldn’t force a single break point and double-faulted to go 5-3 down in the second-set tiebreaker.

Zverev converted his first match point with an ace.

The seventh-ranked German had a major breakthrough in winning last year’s tournament, beating Federer in the semifinals and Djokovic in the final. He’ll come up against Thiem, who impressed by beating those same two players in the group phase this week.

“He’s playing unbelievable tennis, and it’s going to be a very difficult match,” Zverev said. “Honestly, I'm just happy to be in the semis, and from here on we'll just see how it goes.”

Tsitsipas had already secured a semifinal spot by winning his opening two matches but still pushed Nadal to the wire in a match that lasted nearly three hours.

That effort could cost him against Federer, who needed only 1 hour, 13 minutes to beat Novak Djokovic in his final group-stage match on Thursday and spent Friday resting up.

But at 21, Tsitsipas is 17 years younger than Federer, and said he felt confident he’ll recover quickly.

“It’s OK, my body feels well currently,” Tsitsipas said. ”I don't feel pain anywhere. I feel fresh, honestly. After having a long, difficult match like this, I feel like I can go out and play tomorrow the same way. So I don't have any problem with that.”

After saving a match point at 5-1 down in the third set against Medvedev on Wednesday before rallying to win, Nadal’s comeback wasn’t quite as dramatic this time.

He never faced a break point in the match but lost the last three points of the first-set tiebreaker to hand Tsitsipas the lead.

But he broke for a 5-3 lead in the second set and again to make it 6-5 in the third, then converted his first match point when Tsitsipas netted a forehand.

After the match, Nadal was presented with a trophy on court for having secured the year-end No. 1 ranking.

Djokovic’s chances of overtaking him ended when he was eliminated with the loss to Federer.

It’s the fifth time that the 19-time Grand Slam winner ends the year atop the rankings, tied for second on the all-time list with Djokovic, Federer and Jimmy Connors. Pete Sampras did it six times.

At 33, Nadal is the oldest man to finish the year as No. 1.

“Honestly, after all the things that I went through in my career in terms of injuries, I never thought that at the age of 33 1/2, I would have this trophy in my hands again,” Nadal said.

However, he has never won the ATP Finals despite qualifying for a 15th year in a row. He has had to pull out of the tournament on six occasions because of injuries and reached the final only twice, the last time in 2013.

___

More AP Tennis: https://www.apnews.com/apf-Tennis and https://twitter.com/AP_Sports