Andy Murray dropped his first set of this year's Wimbledon on a tie-break to Jo-Wilfried Tsonga to leave himself with plenty of work to do to reach the semi-finals.
Tsonga is one of the most unpredictable players on the men's tour and that was demonstrated in the opening game, with the Frenchman getting himself into trouble with a poor volley and double fault, then blasting his way out of it.
The pair had met three times before, with Murray winning two of those but losing their only previous grand slam meeting in the first round of the Australian Open two years ago.
The 23-year-old had cruised through the opening four rounds while Tsonga struggled, but the 10th seed looked in good touch in the opening stages on Centre Court.
Both players were racing through their service games, with Tsonga frequently rushing the net, but the Frenchman had to dig himself out of a hole in the ninth game.
Murray forced the error on the volley from his opponent but then netted the return on break point and Tsonga survived.
In the next game it was Murray's turn to escape after a wild drive volley had set up set point for Tsonga. He saved that with some decent net play and then powered down two aces to win the game.
Tsonga clearly represented a step up in quality compared with Murray's previous opponents so it was not surprising the Scot found himself in his first tie-break of the tournament.
After the first four points went against serve, it was Tsonga who made the decisive move to lead 6-3. And, although Murray held firm on his service points, the Frenchman clinched it 7-5 with a superb drop volley.
That outcome took Murray's tie-break record for the year to three wins and seven losses, but he had the chance to gain an immediate break at the start of the second set when Tsonga slipped to 15-40.
He could not take either of those chances but a third arrived when the Scot turned defence into attack in brilliant fashion to force the error from Tsonga at the net, and this time he did capitalise thanks to another mistake on the volley.
But all that hard work was squandered with a sloppy game at 3-1, allowing Tsonga to break back. Murray was not playing badly but errors at key times were costing him dearly, and too often his opponent was getting the first strike in.
The Scot was at least serving better than in his victory over Sam Querrey on Monday, and he had a sniff of a second break when a lovely dinked backhand took him to 15-30 at 5-4. Tsonga, though, held his nerve impeccably.
The Frenchman's next service game followed the same pattern, although this time Murray forced deuce. But Tsonga pulled out a second serve at 118mph, leaving the fourth seed waving his arms in frustration, and another tie-break was the inevitable result.
An early mini-break for Murray was quickly retrieved, and he was in trouble when a crunching Tsonga backhand helped him move 5-4 ahead with two serves to come.
The Scot levelled straight away though, with the Frenchman again found wanting at the net, and a bad misjudgement on a Murray return left the Scot serving for the set.
And he took it 7-5, letting out a huge roar after Tsonga went for too much on the return.
Keen to keep the momentum, Murray pressed for a break at the start of the third set, and he forced deuce with a terrific defensive lob. But this time Tsonga held firm.
The Scot's defensive abilities are second only to Rafael Nadal, who was waiting in the last four, and an amazing scrambled forehand took him to 0-30 in the 10th seed's next service game, which quickly developed into a crucial moment in the match.
Five break points came and went, with Tsonga's power - and a little help from the net in one case - keeping his opponent at bay. But on the sixth Murray kept his passing shot low enough to force the Frenchman to volley wide.
Having finally got the break, the 23-year-old seemed set to give it straight back when he slipped to 15-40 but he used his favourite drop shot to pull it back to deuce and held on.
The tide was slowly turning in the home favourite's favour, and the second set was almost in the bag when some resigned shots from Tsonga helped Murray break again.
That took him to 4-1, but the Frenchman recovered from his mental lapse to ensure it would not be a stroll for the British number one, forcing him to save a break point before serving out to win the set 6-2.
Tsonga persisted with his tactic of coming to the net as often as possible, despite frequently being outwitted by Murray, and he paid for it again at the start of the fourth set as a backhand pass took the Scot to 30-30.
This time he did not need to come up with any heroics to break as the 10th seed threw in two poor errors.
Indeed, Tsonga seemed to have stopped believing in an upset that looked very likely for the first two sets and it was no surprise to see Murray break again.
The Le Mans-born 25-year-old also looked to be stuggling physically after a testing passage through the first four rounds and, although he avoided a whitewash, the end was swift in coming.
Tsonga saved one match point with a crunching forehand, forcing the world number four to serve it out. And Murray sealed the 6-7 (5/7) 7-6 (7/5) 6-2 6-2 victory in style with a searing forehand winner.