The Croatian was made to work for his victory, with the first set going to a tie-break before he came out 7-6 6-2 winner.
Cilic broke first in the opening set, but the Spaniard soon hit back. Both struggled to hold their serve before the Croat dug deep to take the tie-break 7-4.
The second set was a different story, with Cilic breaking for 3-0 and again for 5-2 to keep a firm stranglehold on the game.
With a 6-2 advantage, he served out an ace at 40-15 to book his place in the quarter-final of the competition.