Andy Murray survived a rollercoaster encounter with volatile Italian Fabio Fognini to reach the fourth round of Wimbledon.
The defending champion had breezed through his opening two matches but found his future in the tournament under serious threat amid a deafening atmosphere on Centre Court.
Fognini is a fiery character and was docked a point for obscene behaviour but had five chances to force a deciding set before Murray fought back to win 6-2 4-6 6-1 7-5.
The world No 1 now has two days to recover before facing Frenchman Benoit Paire on Monday.
Murray had talked up the threat of Fognini, who is more comfortable on clay than grass but a talented shot-maker on any surface.
Murray won just six games in their most recent meeting in Rome in May and had lost half of their previous six matches.
Fognini was the third unpredictable opponent in a row for the world No 1 after Alexander Bublik and Dustin Brown.
But, with Fognini, it is less about his shots than the casual manner with which he struts round the court and his propensity to fluctuate wildly in form and focus.
The first set was a case in point, with Fognini dialled in for the first four games only for Murray to run away with it.
Fognini served consecutive double faults in the final game but then regrouped at the start of the second set and became the first player to break the Murray serve all tournament.
But the 28th seed then dropped serve himself, reacting by angrily slamming his racket to the turf, earning himself a code violation and probably a sizeable fine.
Fognini, one of the more combustible players on the tour, already owns the record for the biggest single fine in Wimbledon history after being penalised 27,500 US dollars (around £16,000 at the time) in 2014.
There was little rhythm to the match and Murray was in trouble again after a weak backhand barely halfway up the net gave Fognini another break for 3-2.
This time the Italian held onto his advantage, and Murray knew how important it was not to allow Fognini to carry momentum into the third, letting out an almighty roar when he held serve in the opening game.
The Murray limp was still in evidence but it was his opponent who now appeared to be struggling physically, with Fognini taking a medical time-out to have his right foot taped.
The set quickly went Murray’s way but Fognini got back in the game at the start of the fourth and threatened the Murray serve in the fourth game.
Murray completely shanked a second serve to trail 0-30 but pulled back to level and, after losing the next point, Fognini responded by sucking on his finger.
It was deemed an obscene gesture by umpire Damien Dumusois and, having already been warned for abuse of his racket, Fognini was docked a point and lost the game.
He argued his case with Dumusois to no avail but the incident fired up the lively evening crowd and it was Fognini who took advantage.
A sixth Murray double fault handed Fognini the break for 4-2 and, the Scot had to save two set points in his next service game.
Fognini looked set to clinch it at 5-3 40-15 but there was more drama to come.
After Murray saved one, Fognini stopped mid-rally on the second when he thought a Murray forehand had landed long but the Italian had forgotten he had used all his challenges.
It cost him the point, and Centre Court roared when Fognini dumped a drop shot in the net to hand Murray the break back.
The defending champion saved a fifth set point to level at 5-5 and then took full advantage of Fognini’s frustration by making it four games in a row.
That left him serving for victory in the gloaming, and this time there were no more twists as Murray clinched it with his 14th ace after two hours and 39 minutes.
Novak Djokovic’s coach Andre Agassi believes the Serbian is happy with his game again but has shied away from committing to a long-term partnership.
Agassi has been working with Djokovic since the French Open in a bid to arrest the 12-time major champion’s dramatic dip in form.
Asked if he believes the ‘big four’ – Djokovic, Andy Murray, Roger Federer and Rafael Nadal – are the prime contenders at SW19, Agassi said: “I do. After two rounds it’s hard to get too much of a sense of exactly where everybody’s at, but it sure seems that way.
“I can speak for Novak and he seems as comfortable as I’ve seen him in a long time.
“Every round is a threat moving forward, it really is. You can’t take it for granted.”