World number two Andy Murray fought back from a set and a double break down to beat Benoit Paire and reach the Monte Carlo Masters quarter-finals.
The Briton eventually won 2-6 7-5 7-5 in two hours and 33 minutes against the 26-year-old Frenchman, who served for the match in the final set.
Murray, 28, will face Canadian Milos Raonic in the last eight.
Roger Federer, eight-time champion Rafael Nadal and 2014 winner Stan Wawrinka are also through.
"Hopefully I can start to play a little bit better," said Murray, who has already reached the doubles quarter-finals alongside fellow Briton Dominic Inglot.
"Every win is important right now at the start of the clay season to get a feel for what is going well and what isn't."
'I fought as hard as I could'
Murray recovered from a seemingly hopeless position to earn a vital win as he looks to build some form heading into the French Open next month.
Since returning to action following the birth of his daughter in February, the Scot had lost his second matches in Indian Wells and Miami last month - and looked on course for another early exit in Monte Carlo.
"He gave me an opportunity in the middle part of the second set when he started to make a few mistakes," added Murray.
"It still wasn't my best match, but I fought as hard as I could right to the end and managed to get the win based on that."
Paire hit 47 winners, keeping Murray guessing with numerous drop shots as he forged into a commanding 6-2 3-0 lead.
However, the Frenchman would end the match with 52 errors and having double-faulted when serving for the match, and on Murray's first match point.
Murray steadied himself after struggling with his first serve in the early stages and edged through an unpredictable contest that saw 10 breaks of serve.
"I panicked," said Paire. "It's the biggest disappointment of my career."
Murray next faces Raonic in a rematch of their Australian Open semi-final, after the 10th seed beat qualifier Damir Dzumhur 6-3 4-6 7-6 (7-5).
Nadal overcomes in-form Thiem
Fifth seed Nadal saved 15 of 16 break points in the first set on his way to beating Austria's Thiem 7-5 6-3.
Thiem beat Nadal on clay in Buenos Aires earlier this year but the 22-year-old but could not repeat the feat as a host of opportunities slipped by.
Nadal will next play fourth seed Wawrinka, who saw off French 15th seed Gilles Simon 6-1 6-2, while third seed Federer beat Spanish 14th seed Roberto Bautista 6-2 6-4.
Never want to miss the latest tennis news? You can now add this sport and all the other sports and teams you follow to your personalised My Sport home.