Roger Federer was pushed to three sets before beating Philipp Kohlschreiber 6-4 4-6 6-4 in the Swiss Indoors second round on Thursday.
The match swung on a single break of serve in each set, and top-seeded Federer took two of only three break-point chances he had.
Federer broke for a 5-4 lead in the deciding set when the 32nd-ranked German sent a crosscourt forehand wide.
The Swiss master – seeking a seventh title at his hometown event – will play David Goffin of Belgium in Friday’s quarter-finals.
Donald Young beat fourth-seeded Kevin Anderson of South Africa 6-2 7-6 (6) to set up an all-American quarter-final in Federer’s half of the draw.
Young next faces Jack Sock, who beat another compatriot, sixth-seeded John Isner 7-6 (5) 6-3.