After Djokovic won an opening-set groundstroke battle with steady accuracy and well chosen forays to the net, Bautista Agut used his big forehand to come back from 4-2 down in the second and win the next four games to level the match.
The world number one smashed his racquet after losing the second set but made better use of its replacement, winning the third following a service break in the fifth game, before raising his performances in the fourth set to claim victory.
“I was upset with myself,” said Djokovic. “But I managed to regroup. The important thing is that I managed to find a way to win.”
The Spaniard unleashed 34 winners, including 22 from the forehand, but came up short in a quest to reach his first grand slam quarter-final.
“I wanted to play a fifth (set),” the 23rd-ranked Bautista Agut said. “I think I played great tennis and I enjoyed it on the court.
“I think sometimes I felt he was not comfortable on the court. I was moving him a lot and that’s what I wanted before the match.”
Djokovic commended him on his play.
“Credit to him for fighting, for making me work,” said the Serb, winner of this year’s Australian Open and Wimbledon titles. “It was a very physical match.
“He made me work for every point.”
Djokovic will meet Spain’s Feliciano Lopez, who beat Italian Fabio Fognini 6-3 7-6(5) 6-1, in the quarter-finals.
Only Jimmy Connors (27) and Roger Federer (36) have registered more consecutive grand slam quarter-final appearances in the Open era than Djokovic.
“I’m proud of the fact that I’ve been able to achieve so much in my career so far and to be able to play my best in the grand slams, which I was always aiming for,” the nine-times grand slam winner said.
“I’m always trying to set up my form, shape, for these events. This is where I want to peak.”
(Editing by Greg Stutchbury)