Top seed Rafael Nadal has set up a quarter-final showdown with Dominic Thiem after beating Georgia's Nikoloz Basilashvili with a 6-3 6-3 6-7(6) 6-4 at the U.S. Open.
The world number one looked like he would cruise to an easy win after pocketing the first two sets but the Georgian stepped up his game to take the third set.
The U.S. Open champion would not be denied and fired his seventh ace on match point to end the three hour, 20-minute tussle.
"Two matches in the row that were very tough ones," said Nadal, who had to battle back against Russian Karen Khachanov two days ago.
Nadal praised the 26-year-old Basilashvili, who will break into the top 30 for the first time when the new rankings are released after the tournament.
"He played fantastic. A lot of credit to him. He was playing great, hitting the ball very, very strong," he said.
"I'm very happy to be through," added Nadal after setting up a rematch of June's French Open final, when he crushed Thiem in straight sets to win his 17th major.
Ninth seed Dominic Thiem stepped up his bid for a first Grand Slam title toppling last year's runner-up Kevin Anderson 7-5 6-2 7-6(2) to reach his first US Open quarter-final.