Federer clinched the 7-6(5) 7-6(4) victory on his third match point shortly after Wawrinka fell 4-6 6-2 6-1 to 16th-seeded German teenager Alexander Zverev.
Bautista Agut played the match of his life, hitting the ball deep with relentless precision in an effort to keep Federer pinned to the baseline, giving the 18-times grand slam champion everything he could handle.
But Federer’s class proved the difference in the tiebreaks as he improved to 6-0 lifetime against Agut and advanced to a quarter-final match against Czech 10th seed Tomas Berdych.