Andy Murray survived a couple of scares to book his place in the US Open fourth round with a 7-6 5-7 6-2 6-3 victory over awkward Italian Paolo Lorenzi.
Murray was given his toughest test of the opening week in New York and having sailed past Lukas Rosol and Marcel Granollers, Lorenzi made him work for every single point in a match that lasted 3hrs and 17mins and included a breathtaking 42-shot rally.
The veteran Italian served for both the first and second sets, but Murray held his nerve and broke back on both occasions taking the first set on a tie break before giving away the second when serving at 5-6, Lorenzi taking advantage of not having to serve it out.
With the match level at one set all, Murray put his foot on the accelerator to dominant his opponent and despite the occasional flash of brilliance from Lorenzi it was Murray's shotmaking and improved first serve that sealed the win and a place in the last 16 where he will face Grigor Dimitrov.
Lorenzi's determination seemed to cause Murray no end of problems and while Murray's unforced error count and early first serve percentage will give the world number two cause for concern, Lorenzi's persistence was to be applauded and ensured Murray had to battle all the way.
Lorenzi, who had only won two previous matches in Grand Slam events during his career, was playing in the third round of a major for the first time and showed no signs of nerves as he matched Murray throughout the first set.
Murray seemed eager to force the issue and he racked up 28 unforced errors in the opener, eventually finding his range in the tie-break which he sealed 7-4.
The world number two started in blistering fashion in the second set, breaking Lorenzi in the first game only to see the Italian reel off eight points in succession to break back and then turn the set in his favour with a break in the sixth set.
Murray had chances to break back immediately, missing a simple-looking overhead volley at the net at 30-all to allow Lorenzi to hold onto his serve and lead 5-2.
But as he did in the first set, Lorenzi wilted under the pressure. With Murray holding onto his serve, the Scot then mustered his most sustained spell of tennis by breaking in the next game for 4-5, a game that included a spectacular 42-shot rally that Murray won.
But the Italian, ranked number 40 in the world, would not be outdone and without the pressure of serving for the set he turned the tables on Murray to break in the 12th game and level the match.
Murray saved his best tennis for the fourth set, giving a tiring Lorenzi no chance with a string of winners and a couple of breaks that gave him the set 6-2 and moved him to within one set of a fourth round place.
The 29-year-old broke early on again in the fourth set, in fact for the third set in succession Murray seized the advantage on the Italian's serve in the opening game of the set.
And with Murray's own serve looking under little threat the Scot moved into a 3-2 lead before Lorenzi mustered the first challenge on the British number one's serve in the sixth game. But Murray stayed strong and survived a rare break point before going on to close the match.
Up next for Murray will be a tenth career meeting with Bulgarian Dimitrov who beat Portugal's Joao Sousa in four sets.
Murray lost to the 22nd seed in Miami earlier this year and also suffered a quarter-final defeat to the hugely talented 25-year-old at Wimbledon in 2014.