Roger Federer celebrates after a tough match against Adrian Mannarino at the Swiss Indoors. Photo: Alexandra Wey/Keystone via AP

BASEL – Roger Federer survived a surprise test at the Swiss Indoors on Friday before making the semi-finals at his home event for the 14th time with a hard-fought 4-6 6-1 6-3 win over Adrian Mannarino.

The French seventh seed, who had dropped 10 straight sets in four losing matches against the world number two, shocked the home crowd at the St Jakobshalle by winning the first set.

Mannarino broke to love for a 5-4 lead to quickly establish early superiority.

But Federer, who lost just eight games in his first two matches, rose to the occasion, levelling at a set each with two service breaks.

In the third set, the Swiss top seed saved break points in the sixth game for 3-3 before breaking for a 4-3 lead with a backhand winner.

Federer, 36, completed his great escape one game later with a break, firing an untouchable passing shot on a first match point to take the win in just under one and three-quarter hours.

“Just because you’ve never lost a set, people expect it to keep happening,” Federer said.

“But every day you feel different. It’s hard to start out and play your absolute best next time.

“I had to dig and fight tonight. It was tough for me to get into it, he was solid in the first set and deserved to win it. But the reaction from me was really important.”

The Swiss veteran fired 12 aces and advanced to a semi-final against third seed David Goffin, who downed American Jack Sock 7-6(6) 6-3.