Roger Federer began his bid for a sixth title at the Swiss Indoors by beating substitute opponent Benjamin Becker 7-5 6-3 on Monday to reach the second round.
The German, ranked 83rd with one career title, replaced injured Frenchman Jeremy Chardy as the first opponent for the Swiss home hero and world number one.
Federer, who has won five of the past six editions at the St Jakobshalle where he got his start in tennis as a ballboy almost two decades ago, needed to work to get past the persistent Becker, whom he beat in their previous two meetings, the last in 2010.
"I was well-prepared to play Becker instead of Chardy," said Federer, bidding for his 77th career title this week and after more than 300 weeks spent as the ATP Tour's number one.
"You have to keep the game of these guys in mind, You don't play them that much but you need to know how they play."
He advanced in just under 90 minutes after a first set which took an hour.
Federer fired 10 aces but missed on six break points in the opening set and went down a break in the second before finally settling in.
"I don't know exactly how I changed it around," said Federer, playing his first match since losing a Shanghai semi-final nine days ago to Andy Murray.
"He broke me at 2-3 but I was able to get it straight back. It all went so fast at the end, but the first set was really tough."
Federer's win was his 65th of the season against nine losses. He owns an ATP-leading six titles in 2012.
Federer is making his 13th appearance in his hometown tournament and now stands 44-7 at the event. Besides his five titles he also played finals in 2000-01 and 2009.
His next an opponent will be either Brazilian Tomaz Bellucci, finalist at the weekend in Moscow, or Japan's Go Soeda.
Elsewhere in the first round, Julien Benneteau of France beat Russian Andrey Kuznetsov 4-6 6-3 6-3 while Pole Lukasz Kubot advanced over Slovak Lukas Lacko 6-4 6-4.