Ronnie O'Sullivan had to take the last four frames to see off China's world number 104 Chang Bingyu and reach the quarter-finals of the Saudi Arabia Masters.
The seven-time world champion looked to be heading home after trailing 5-2, but he hit back to win 6-5 and set up a last-eight meeting with Kyren Wilson.
Chang, 23, only recently returned to the Tour having completed a two-year ban for his role in the match-fixing scandal which rocked the sport in 2022.
But he looked on course for the biggest win of his career until O'Sullivan sprang into life with a six-minute break of 103 to move two behind.
O'Sullivan took a scrappy ninth frame and when Chang broke down on 53 in the next the 49-year-old capitalised to take it to a decider, in which a virtuoso 125 clearance got him over the line.
"I missed so many easy balls. It's just not good enough to win tournaments," O'Sullivan told TNT Sports.
"But I wasn't battling out there, I was quite enjoying it. But I've got Kyren next. If I miss like that he'll trounce me. "
Wilson, the 2024 world champion, beat Si Jiahui 6-3.
Mark Williams explained the logic behind playing "blind" shots after brushing aside Shaun Murphy 6-1.
Williams pulled off several outstanding pots after closing his eyes before making contact with the cue ball.
"Everything's a blur and I do it to see how well I am cueing," three-time world champions Williams said.
"I've got to do all my alignments stood up because when I am down there it's a guess.
"When I'm doing the shots shutting my eyes it just confirms to me that I'm in the right line really.
"If it misses to the left or right I know which part of the ball I've hit."
Williams will play Elliot Slessor following his 6-5 victory over Stuart Bingham.
Mark Selby became the fifth player to reach 900 career centuries despite a 6-4 defeat to Neil Robertson.
Four-time world champion Selby joined an elite club including O'Sullivan, Trump, John Higgins and Robertson with 119 in the second frame.
The Australian produced two centuries of his own - 111, and 137 in the last frame - to recover from a 4-3 deficit.
Ali Carter rattled off five successive frames to overcome Oliver Lines 6-3 and will play Robertson next.
Chris Wakelin sprung a late-night surprise when he knocked out current world champion Zhao Xintong 6-5, and he will face Barry Hawkins, who beat Ding Junhui in another deciding frame.