HALLE, Germany (AP) Top-seeded Roger Federer overcame a 4-1 deficit in the second set to beat Malek Jaziri 6-3, 7-5 on Thursday and stay on course for his ninth title at the Gerry Weber Open.

Federer caught up and broke serve for 6-5, before serving out the match. Jaziri sent a backhand wide on the first match point.

Jaziri actually hit two more winners than Federer but also had three more unforced errors.

Federer will play fifth-seeded David Goffin in the quarterfinals. Goffin was up 4-6, 7-5, 2-0 when Sergiy Stakhovsky retired with a back injury.

Earlier, eighth-seeded Philipp Kohlschreiber endured 26 aces from Ivo Karlovic in winning 6-7 (7), 6-4, 7-5.

Kohlschreiber will play third-seeded Dominic Thiem in the quarterfinals, a rematch of their showdown in the rain-delayed final of the Mercedes Cup in Stuttgart that was completed on Monday. Thiem beat Kohlschreiber for his first title on grass.

Thiem breezed past Teymuraz Gabashvili 6-4, 6-1.

In other quarterfinals, Andreas Seppy plays Florian Mayer and Marcos Baghdatis meets Alexander Zverev.