The number four seed was pushed hard by his compatriot but came through 6-3 3-6 7-6 7-5 after three hours of tennis.
There was little to separate the two players during the early exchanges, but it was Ferrer who made a crucial break at 4-3 to move two games clear before serving out the first set.
Bautista-Agut improved in the second set, holding serve well before several unforced errors from Ferrer allowed him to break in the eighth game. He held his nerve to take the set on his own serve.
The third set was a tight affair with both players breaking twice and giving little away off their own service games. The set entered a tie-break, which Ferrer claimed 7-4.
The fourth set was equally close as both players continued to dominate off their own serves, but Ferrer found a break in the 11th game before serving out the match to book a place in the next round.