Federer has not hit top form all week in Basel and he needed more than two-and-a-half hours to hold off the troublesome French veteran.
The 32-year-old South African beat fifth-seeded Kei Nishikori 6-3 7-6 (3) to make sure he will feature in the London event, which runs from November 11-18.
It's the second final of the year for Copil.
It still took him four match points over three games to get the job done against a player he beat in three sets in the first round of the Shanghai Masters this month. "It was dream run for me", Federer said in his acceptance speech, before his fans' ovation brought tears welling in his eyes.
After dropping the second set, the world No. 3 grabbed a break of serve early in the decider only to hand it back with a sloppy service game of his own, reports Efe news.
"I was feeling good on court apart from closing it out, I had a few errors there".
Federer started his slow recovery with a break for 4-5; he then saved set points to level at 6-all, winning a game in which he double-faulted twice in a row and saved a set point with an ace.
OnePlus 6T launch event
At the back, there will be same dual rear camera setup but OnePlus is dropping the fingerprint sensor placed below it. We'll also have all the news as and when it happens, so make sure to keep an eye on the Giz UK homepage.
Pochettino proves Spurs not just the 'Kane team', admits Guardiola
Tottenham have made their best-ever start to the Premier League season after collecting 21 points from their opening nine games. One is to win games, but the club needs to be all focused in trying to win titles.
Red Sox clinch World Series title with Game 5 win over Dodgers
Despite their rich baseball histories, this was only the second time these two teams faced each other in the World Series. Pearce smashed three home runs, including two in Game 5, and hit.333 en route to his first career World Series ring.
Federer broke in the second game of the final set but Simon refused to give in and replied in the seventh. Federer has never lost a championship match to an opponent ranked below World Number 87.
"It will be a challenge but I'm excited to see how I feel tomorrow, playing a young guy", said Federer.
Just hours after, though, Federer dropped a major retirement hint while speaking to the ATP World Tour following his 99 triumph.
The top seed claimed his ninth trophy at his home event as he overcame an inspired opponent who took the lead early in each set but was pegged back by the 20-time Grand Slam champion.
Federer's semifinals opponent will be seventh-seeded Russian Daniil Medvedev, a 6-4, 3-6, 6-3 victor over Greek fourth seed Stefanos Tsitsipas in the day's final match.
Federer began the year by winning the Australian Open and his ninth Basel title was his fourth of the season but the first since his victory in Stuttgart in June.