Roger Federer stayed on course for a 10th Halle Open title with a battling win over Roberto Bautista Agut, while Alexander Zverev suffered a quarter-final defeat to David Goffin.

Federer had to roll up his sleeves to reach the last four of the tournament for a 15th time, winning 6-3 4-6 6-4 on Friday.

The top seed was taken the distance by Jo-Wilfried Tsonga in the previous round and saved four break points as Bautista Agut put up a strong fight.

Federer has won all nine matches against the Spaniard, his latest sealed with a break when his opponent was serving to stay in the match.

The 20-time grand slam champion will now come up against Pierre-Hugues Herbert, who advanced when defending champion Borna Coric retired with a back injury after losing the first set 7-5.

Zverev's hopes of landing the title in his homeland were dashed when Goffin rallied to take out the second seed 3-6 6-1 7-6 (7-3).

Goffin fought back from 3-1 down and Zverev saved two match points before the Belgian prevailed in a decisive tie-break.

The unseeded Goffin will face Matteo Berrettini in the last four after the Italian, a champion in Stuttgart last week, stayed in the hunt for back-to-back titles with a 6-2 7-6 (7-4) defeat of third seed Karen Khachanov.