Andy Murray dug himself out of a huge hole against Marin Cilic to reach the semi-finals of the US Open for the third time.
At a set and 5-1 down, the third seed looked in danger of suffering one of his biggest grand slam disappointments but he turned things around and levelled the match on a tie-break.
That made Murray a big favourite and he reeled off 11 straight games to win 3-6 7-6 (7/4) 6-2 6-0 and set up a last-four clash against Tomas Berdych.
The Scot said: "He played very well at the start and I struggled a little bit. When I managed to get the breaks back in the second set I relaxed a little bit.
"I've been in that position before when you're serving for a two-set lead and someone comes back and it's tough. The fourth set I played better."
Murray had been due to play on Arthur Ashe but the match was moved to Louis Armstrong because rain had put things behind schedule.
This was the scene of Murray's third-round struggle against Feliciano Lopez, and the early signs were not good as the third seed won only one of the first 10 points, losing his serve to love.
Murray had beaten Cilic in six of their seven previous meetings, including in straight sets in the fourth round of Wimbledon.
But the Croatian's only win came here three years ago in the fourth round, although Murray was hampered by a wrist injury.
The Scot had put in one of his best performances of the season to beat Milos Raonic in the previous round and he needed to rediscover that form quickly.
In truth, neither man was playing well, but Murray was just the more reliable as he retrieved the break to trail 4-3.
However, he promptly gave it straight back, throwing his racquet to the court in frustration, and he paid heavily when Cilic served out the set.
There was still plenty of time for Murray to turn things around but he needed to step things up, particularly on his serve.
He made the worst possible start to the second set with two double faults and found himself facing another break point.
He had not given up one against Raonic but netted a forehand to be broken for the third time in five games.
Cilic has been getting back to something like the form that took him into the top 10 in 2010 and was playing at this stage of a grand slam for the first time since the Australian Open that year, when he lost in the semi-finals to Murray.
That stage looked a long way away for the Scot, especially when he could not take any of three chances to break straight back, Cilic finding a big serve every time.
Murray was flat, his movement sluggish, and he was in huge trouble when he was broken again to trail 4-1 with another abject service game.
The 25-year-old gave himself some hope by retrieving one of the breaks, saving a set point to claw his way back to 5-3.
Cilic had been playing extremely well but, serving for the set for a second time, he threw in three errors to hand Murray three more break points.
Three times the Croatian came up with big serves to hang on but a fourth chance followed and this time Cilic double-faulted.
He held serve to force a tie-break and took a 4-2 lead when Murray reverted to his earlier error-strewn ways.
But the Scot dug in once more and won four points in a row to bring up his first set point, taking the tie-break when Cilic netted a backhand.
It was an act of escapology a magician would have been proud of, but there was still plenty of hard work ahead.
The momentum had certainly shifted, though, and Murray was now looking a lot more relaxed and playing better.
He made the breakthrough in the fifth game of the third set, breaking with a backhand winner to lead for the first time in the match, and was firmly in control when he made it four games in a row.
That left Murray serving for the set and, although he had to save a break point, there was no real drama as an ace down the middle clinched it.
Cilic's head had dropped and it was very difficult to see the Croatian getting back into the match, even more so when a forlorn forehand sailed wide to give Murray a sixth straight game and a break at the start of the fourth set.
That quickly became eight games, and it now seemed a question merely of how long it would take the third seed to wrap up victory.
There was almost a slight twist when Cilic had three chances to retrieve one of the breaks but Murray saved all of them and clinched victory after exactly three hours.