Rafael Nadal turned in another unconvincing display but defeated Nikoloz Basilashvili at the US Open to set up a quarter-final meeting with Dominic Thiem.
Defending champion Nadal had suggested he would need to improve on his "very tough" third-round match with Karen Khachanov, where four sets and two tiebreaks were required, but there was little evidence that the seemingly fatigued world number one had lifted his game at Arthur Ashe Stadium.
Straightforward passage to the last eight still appeared on the cards after the unseeded Basilashvili faded rapidly after a bright start, yet a sloppy third set from Nadal forced him to fight into a fourth once more.
After almost three and a half hours, the three-time winner at Flushing Meadows belatedly came through 6-3 6-3 6-7 (6-8) 6-4 ahead of an encounter with French Open finalist Thiem.
That extra time on the court may prove costly when Nadal is faced with the Austrian, who showed his class to send Kevin Anderson packing, in a clash where a similar performance again would surely be punished.
Basilashvili claimed pre-match that he was playing his best tennis and he showed flashes early on, keeping his esteemed opponent at bay in one thrilling rally that brought him to the net.
But as the Georgian then pressed for a gain, he faltered on serve and handed Nadal two break points, the second taken as he drove into the net from wide on the left.
That was enough for Nadal to take the opener and Basilashvili lost his way again at the start of the second, going long for another break.
Three opportunities came and went for the underdog, with Nadal able to bide his time for a further gain, profiting on careless Basilashvili errors to seemingly cruise towards a simple victory.
But a lengthy hold for 1-1 in the third offered Basilashvili some encouragement just as Nadal started to find the corners of the court and he seized his first break in the following game, powering returns past the top seed.
Although that gap swiftly vanished, the Spaniard never quite got to grips with the third and stumbled in the tiebreak, pegged back when Basilashvili came forward following a big serve to press home his advantage.
Nadal still could not shake off his irritant opponent at the start of the fourth, failing to capitalise on an initial break, but a stunning forehand down the line finally forged a breakthrough before victory was sealed.
Nadal  bt Basilashvili 6-3 6-3 6-7 (6-8) 6-4
Nadal - 29/19
Basilashvili - 56/59
Nadal - 6/3
Basilashvili - 8/8
BREAK POINTS WON
Nadal - 6/16
Basilashvili - 2/7
FIRST SERVE PERCENTAGE
Nadal - 65
Basilashvili - 56
PERCENTAGE OF POINTS WON ON FIRST/SECOND SERVE
Nadal - 75/61
Basilashvili - 69/50
Nadal - 132
Basilashvili - 113