BASEL, Switzerland (AP) Roger Federer overcame mid-match service problems to beat David Goffin 6-3, 3-6, 6-1 on Friday and advance to the Swiss Indoors semifinals.

Top-seeded Federer gave the eighth-seeded Belgian hope in their repeat of last year's final when he dropped two straight service games in the second set to help level the match.

Federer eased the nerves of his hometown fans in a deciding set that started after 11 p.m. local time, quickly killing Goffin's momentum with a service break and cruising to victory.

Seeking a seventh title in Basel, Federer will play 29th-ranked Jack Sock of the United States in the semifinals on Saturday.

Sock rallied to win an all-American match - his third straight this week - beating Donald Young 5-7, 6-4, 6-2 on a day when all four quarterfinals went to three sets.

Rafael Nadal rode another comeback win into the semifinals and outlasted Marin Cilic 4-6, 6-3, 6-3.

Third-seeded Nadal trailed by a set and a break before getting his third three-set win this week.

''I think he (Cilic) was playing great. Then I tried to change position a little bit on (my service) return,'' said Nadal, who on Monday had to break serve to avoid a quick first-round exit against Lukas Rosol.

The match turned when seventh-seeded Cilic's service faltered and Nadal seized a fourth straight break-point chance to lead 5-3 in the second.

Nadal broke service twice more in the decider and clinched when the tall Croatian sent a backhand volley wide.

Nadal's next opponent is Richard Gasquet who had a close escape to reach the final four.

The fifth-seeded Frenchman saved a match point in the deciding tiebreaker to beat big-serving Ivo Karlovic of Croatia 6-4, 6-7 (2), 7-6 (6).

Gasquet got the only break of serve in the match despite 36-year-old Karlovic firing 32 aces.