After wins at the Australian Open as well as Indian Wells and the Miami Open earlier this year, Federer decided to miss out the clay-court season - seen as a move to enhance his prospects at WImbledon, on his favoured grass surface.
However, doubt was cast on his comeback last week as he lost his first competitive grass court match of the season, to 39-year-old Tommy Haas.
ATP Halle
Federer thrashes Zverev to claim ninth title at Halle in style
25/06/2017 AT 12:12
But a week on and Federer looked in better nick, dispatching Zverev with relative ease in Germany.
Though the Swiss squandered three set points at 5-4 in the first set, and appeared to be lacking some of his sharpness, he managed to win the tiebreak by whipping a crosscourt backhand winner on his fourth set point.
Zverev's first serve seemed inconsistent and Federer broke at 4-4 in the second set to break the German, before serving out the match.
Federer will face defending champion Florian Mayer in the quarter-finals.
Additional reporting by Reuters.
ATP Halle
Federer moves into 140th career final at Halle
24/06/2017 AT 13:06
ATP Halle
Federer eases past Mayer to reach Halle semi-finals
23/06/2017 AT 16:17