British number one Andy Murray came through a gruelling match against Jonas Bjorkman 5-7 6-3 6-1 4-6 6-1 to reach the third round of the US Open.
It was a frustrating day for Murray at times
The 20-year-old was in trouble when he dropped a tight first set and quickly went a break down in the second.
But from 2-3 down, he reeled off nine games in a row to take control.
Bjorkman, 35, took advantage of a weary Murray to force a decider but the Scot found the energy to break serve early and the Swede could not recover.
Murray will face an unexpected foe in round three after 31-year-old Korean Hyung-Taik Lee stunned 14th seed Guillermo Canas 7-5 7-5 6-3.
The Briton said he was pleased to come through a five-set match after spending four months out with a wrist injury.
"It's a good win for me: to play in this heat for three hours and 45 minutes and come through against a player of Jonas's quality," said Murray.
"I was hitting my forehand harder and more consistently - although it still needs to get more consistent.
"Jonas is in great shape for his age and he knows how to pace himself in a five-set match so you need to be pretty switched on.
"For me to play him is great - he's been awesome for tennis these last 15 years or so."
After a comfortable first-round win, Murray had spoken of trying to enjoy his tennis more - but there was little evidence of that on a sweltering day in New York.
During a scrappy first set, the 20-year-old frequently muttered angrily to himself as his groundstrokes - in particular his forehand - failed to find their mark.
His serve, too, was misfiring and Bjorkman took advantage of Murray's first-serve percentage of 49% to edge a tight first set.
Matters did not improve at the start of the second set and Murray received a warning for an audible obscenity after dropping serve to go 2-0 down.
But after breaking straight back, Murray suddenly found a rich vein of form.
The world number 19 produced some dazzling winners, which left Bjorkman, for all his experience, looking dumbfounded.
Murray rattled through the third set in 34 minutes - but Bjorkman refused to capitulate.
The Swede twice went a break up as his younger opponent, who is short on match practice after a long lay-off with a wrist injury, began to struggle physically.
Murray hit back both times but at 4-5, his first serve deserted him and Bjorkman put away a crisp volley to take the match into a decider.
But as the fifth set got under way, it was the 35-year-old's turn to look weary as Murray found new reserves of energy.
Once he had broken serve in the opening game, Murray concentrated on getting a high percentage of first serves in and it proved to be a decisive tactic.
The Scot raced through the deciding set in 34 minutes, before slumping into his chair with relief.