It was not a totally convincing performance from the defending champion against Denis Istomin but he did what he had to do to come through 6-7 (5/7) 6-1 6-4 6-4.
Murray has become a master at negotiating such hurdles at grand slams but he will need to play a lot better if he is to get past old rival Stanislas Wawrinka in the last eight.
The Scot played his previous match against Florian Mayer in stifling heat and humidity but it was cool and windy on Arthur Ashe for his night-time clash with Uzbek Istomin.
The first set was cagey from both players but it was Istomin who clinched it by winning the final four points of the tie-break.
Murray responded well, as he invariably does in such situations, but he never looked comfortable and celebrated in a manner that indicated how much of a struggle it had been.
The Scot denied he was troubled by his long-term back problem, saying: "I'm just a bit stiff today. It was extremely cold on the court, very windy.
"Often when you heat up and then sometimes in between sets or if you have quite a long break, with the wind, you cool down pretty quickly.
"It was very, very different conditions to the last few days where it's been very humid and you have been sweating a lot.
"I wanted to just try and get through the match.
"With the way he plays, he hits the ball pretty big and flat on both sides, his strokes are pretty low and 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."
Wawrinka, who is having a great season and knocked out fifth seed Tomas Berdych, was the last man to inflict an early grand slam defeat on Murray when he beat him in the third round in New York in 2010.
Since then Murray has reached at least the quarter-finals at his last 11 slam tournaments - he missed the French Open this year through injury.
It took most of the first set for both Istomin and Murray to get their eye in in the swirling breeze.
The world number 65 is unique among top-level men in being coached solely by his mother Klaudiya, and he is a talented shot-maker who has given a lot of the leading players some trouble.
The pair had met once before, in Brisbane earlier this year, with Murray winning in two close sets.
It was Istomin who struck first here, breaking for 5-3, but back came Murray immediately and he looked poised to win the tie-break at 5-3 ahead.
The Scot faltered, though, one great piece of play from his opponent and three unforced errors giving Istomin the set.
Murray made a much better start to the second, a fizzing forehand helping him break in the second game, and with an hour and a half of the match gone he was level.
Istomin did, though, have the satisfaction of winning a point with a between-the-legs shot, Murray somehow missing a simple volley.
The third set was a mixture of the very good and the sloppy from Murray, who broke for 2-1 only to give his advantage away three games later.
His forehand was beginning to really fire and he finally converted a fourth chance to break again in the seventh game.
It remained a struggle in the fourth set and In the end it was a huge stroke of luck that helped Murray clinch the crucial break of serve in the ninth game.
Murray had seen one break point come and go when he framed a forehand high into the night sky.
Amazingly it dropped in and the third seed capitalised before serving out the victory in three hours and seven minutes.
Istomin certainly entertained the crowd, doing keep-ups at one stage and attempting three shots between his legs.
The first of those came at a tight moment in the first set when he put the ball in the net despite being in a great position to hit a conventional winner.
Murray said: "He had a pretty easy shot. I personally wouldn't try something like that at that stage, but he did. It was a bit surprising."