Defending US Open champion Andy Murray beat Uzbekistan's Denis Istomin to set up a quarter-final against Stanislas Wawrinka on Thursday.
The Briton was irritated by a number of bad line calls and struggled for consistency on a windy evening, but was not seriously threatened in a 6-7 (5-7) 6-1 6-4 6-4 win.
Murray, 26, was given prime-time billing on Arthur Ashe Stadium and duly delivered the expected victory to reach his 17th Grand Slam quarter-final.
However, it was hard going over three hours and seven minutes after he let a winning position slip in the first set, and it was 11.44pm local time (04:44 BST) by the time he punched away the winning volley.
He will next face ninth seed Wawrinka on Thursday after the Swiss upset fifth seed Tomas Berdych 3-6 6-1 7-6 (8-6) 6-2 on Louis Armstrong Stadium.
"I wanted to just try and get through the match," said Murray. "In the end it was difficult conditions. It was extremely windy.
"With the way he plays, he hits the ball pretty big and flat on both sides, strokes pretty low, hard at times to control. He made it very difficult for me.
"With the way the third set ended up going, I was just very happy to get it done because he had chances at the end of the third set to go ahead."
Murray could only show the quality that has brought him the US Open and Wimbledon titles in occasional bursts against Istomin as both men struggled in the conditions.
Three forehand errors from Murray handed Istomin a chance to serve for the opening set, but when the Scot broke back immediately it seemed as if the world number 65 had missed his opportunity.
A bizarre bit of showboating from Istomin, who attempted a between-the-legs shot that was never likely to come off, suggested he too had given up the ghost.
Murray had the set on his racquet at 5-3 in the tie-break but a dreadful couple of minutes followed, with Istomin firing a wonderful forehand down the line and the champion offering up three errors.
Having dropped his second set of the tournament, Murray set about snuffing out the danger with a beautiful cross-court forehand winner to break at the start of the second.
He made just two errors off the ground as he dominated the set, and a run of nine from 11 games had him in command at 3-1 in the third.
The sense of irritation lingered, however, and one overrule by the umpire early in the set prompted the Briton to plead: "We have to replay that point? Are you kidding me?"
Istomin remained alive to the situation, keeping the pressure on as best he could, and another Murray slump in game six ended with a backhand in the net that brought the scores level.
At one set all and 3-3 in the third, the match was in danger of developing into a real dogfight but, once again, when tested Murray came up with what was required.
He threw everything into the next game, finally converting his fourth break point with a forehand into the corner, and then produced the shot of the night with a forehand winner after some magnificent scrambling in defence.
There were no more alarms as Murray closed out the set and made his move at 4-4 in the fourth, breaking thanks to a towering shot that caught the wind before Istomin made the decisive error.
Murray pounced to put away a high forehand volley on match point and celebrated with a clenched fist and gritted teeth that spoke of a testing evening's work.
"I think hopefully I'll start playing a little bit better from now on," added Murray.
"I mean, sometimes the first week of a Slam I've played very well, sometimes you maybe feel like there's a little bit of something to lose. I don't know.
"But I'm in the quarter-finals of a Slam. It's not an easy thing to do, and the matches are going to get tougher. I'll have to up my game."