World number two Andy Murray had to fight back to beat wildcard Mathias Bourgue in five sets and secure his place in the French Open third round.
The British number one lost eight consecutive games to drop the second and then the third sets to the inspired 22-year-old Grand Slam debutant.
But Murray, 29, used all his experience to seal a 6-2 2-6 4-6 6-2 6-3 win over the world number 164 from France.
Fellow Briton Kyle Edmund lost 6-4 6-4 6-4 to American 15th seed John Isner.
Aljaz Bedene, who plays on Thursday, is the only other British player left in the singles tournaments in Paris.
Murray was also taken to five sets in the first round by veteran Czech Radek Stepanek.
The Scot’s inconsistent form has been perplexing considering he beat Novak Djokovic in the Italian Open final in his last match on clay.
He now goes on to face 27th seed Ivo Karlovic from Croatia in the third round on Friday.
- Today’s matches: Scores, results and order of play
- Report: Watson loses to 13th seed Kuznetsova
What Murray said
“Mathias was excellent and made me run a lot. He’s got a fantastic future for sure.
“I led 6-2 2-0 then he started playing unbelievably and I was finding it hard to win points, let alone games. I’ve played matches like this before and tried to fight through to the end because your opponent can hit a rough patch.
“You can’t play too many matches like this if you want to go far in this tournament. I hope to win the next one a little bit faster.”
Lacklustre Murray’s game falls apart
Murray looked in complete control at 2-0 up in the second set, but his game collapsed in spectacular fashion.
Bourgue broke Murray three times and won six games in a row, including 16 unanswered points as the Briton made numerous unforced errors, to take the set and level the match.
The pattern continued as Murray double-faulted twice in the opening game of the next set.
Murray finally broke Bourgue’s eight-game winning run by taking the third game of the set.
Bourgue was also dominant on his own serve, holding to love six times out of seven, as a subdued Murray, having now lost 28 out of the last 32 points, continued to make mistakes.
The Frenchman had three break points in the next game but Murray – yet to show any of the passion evident during his tussle with Stepanek – battled back to hold serve.
Bourgue continued to produce an array of winners, including the deftest of drop shots, to delight the home crowd in Philippe Chatrier court.
The Frenchman, showing few signs of nerves, secured the set with a stunning backhand down the line to leave Murray facing an almighty battle to stay in the tournament.
Murray battles back
The Frenchman had three chances to break Murray in the opening game of the fourth but crucially the Scot held on, and celebrated with his trademark roar and a fist-pump.
At last Murray broke Bourgue’s serve and followed that by holding his own to love, as confidence slowly returned to his game.
With Bourgue perhaps struggling with his fitness, Murray started to make his opponent work harder and clinched the set with a break to love to level the match.
Murray sensed his opportunity and took advantage of some rare errors to break the Frenchman in the fourth game of the decider.
The Briton served for the match at 5-1 but failed to close it out before finally sealing victory after three hours and 34 minutes on court.
BBC tennis correspondent Russell Fuller
“What an extraordinary performance from Mathias Bourgue, who played an exceptional game of tennis in set number three after Murray’s game went spectacularly off the rails in the second.
“But Murray has done it again and come from behind to win in five sets. Who knows how much this has taken out of his tank and whether he can find the form to challenge the likes of Djokovic and Rafael Nadal, but he is the ultimate street fighter and has crawled over the line again.”
- Murray’s five-set win was his 10th out of his last 11 five-set matches. His only five-set defeat in that time came against Novak Djokovic in the semi-finals at Roland Garros in 2015
- The lowest ranked player Murray has lost to in a Grand Slam is Arnaud Clement, who was ranked 91 at the 2005 US Open
- The second seed has not lost before the third round at Roland Garros since Andy Roddick fell to Jose Acasuso at this stage in 2005
Subscribe to the BBC Sport newsletter to get our pick of news, features and video sent to your inbox.