A tenacious Novak Djokovic survived a US Open late-night fright, battling back from two sets down to tame fellow Serb Laslo Djere with 4-6, 4-6, 6-1, 6-1, 6-3 to move into the fourth round at Flushing Meadows.
On the ropes and reeling Djokovic, as he has done many times before, he snatched victory from the jaws of defeat in front of a record crowd inside a breathless Arthur Ashe Stadium court.
It marked the 38th time Djokovic has won a five-setter and kept alive the 36-year-old's quest for a fourth U.S. Open crown that would pull him level with Margaret Court's record haul of 24 Grand Slams.
"I hope you enjoyed the show, it was not so enjoyable for me, especially in the first two sets," Djokovic told the crowd. "It was one of the toughest matches I have played here in many years."
Djokovic had looked imperious in his opening two matches, surrendering only 11 games in blowout wins over Frenchman Alexandre Muller and Spaniard Bernabe Zapata Miralles, but his 32nd-seeded countryman proved a far tougher test.
The two Serbs had only clashed once before that, in Belgrade last year, but there were signs then that Djere was a danger, with the contest needing three sets and two tie-breaks before Djokovic claimed the win.
Djere signalled to Djokovic he was in for more of the same on Friday when he broke the second-seed to start the match and then held his nerve the rest of the set for an unexpected and well-earned 1-0 lead.
Facing one of the greatest players of all time under the bright lights of tennis's biggest stage, a fearless Djere could not be rattled, piling on the pressure with another break to go up 4-3 in the second on the way to a 2-0 lead that left Arthur Ashe Stadium stunned.
Djokovic was not without his opportunities but did not capitalise on his chances until backed into a corner.
With the crowd still buzzing, Djokovic came out for the third set with an urgency and energy missing in the opening two sets, breaking Djere at the first opportunity and again to go up 4-0 on the way to cutting the deficit to 2-1.
"I did a little pep talk in the mirror," said Djokovic about his bathroom break after the second set. "I kind of laughed at myself because I was agitated and annoyed with the result, I had to kind of force myself to lift myself, to lift the spirits up."
With cracks in Djere's game starting to appear, Djokovic continued to dial up the pressure breaking again to open the fourth set pulling a mighty fist pump from the 36-year-old.
But Djere was not done immediately breaking back, setting the stage for what was a marathon third game that saw Djokovic regain control with yet another break.
Moving in for the kill Djokovic swept the next six games to take the fourth set and a 2-0 lead in the decisive fifth that he would never surrender.
"Once I got the break in the third, I thought 'OK, I have a shot, I have a chance," said Djokovic. "I might as well go after it."
"I started to play a bit more aggressively and read his games slightly more than I had in the first two sets, and it worked well.
"But trust me, it was nerve-wracking all the way till the last shot," he added.