Andy Murray battled back from a set down to beat qualifier Roman Safiullin 6-7 (5-7) 6-3 6-4 at the Swiss Indoors in Basel.
In the final set, the former world No 1 overcame a break of serve to then win five successive games and overturn a 4-1 deficit to move to the next round.
He will now face either Spain’s Roberto Bautista Agut or Serbia’s Laslo Dere.
Murray is currently ranked 49th in the world, and he was originally drawn against Sebastian Korda, who he lost to at the Gijon Open quarter-finals earlier in October, but the American was forced to withdraw with injury.
Despite responding immediately to seeing his serve broken in the first set, world No 93 Safiullin edged the opening set in a tie-break.
Murray recovered five break points early in the second set and battled back to take it and level the match.
It looked like Murray would face a shock exit to the qualifier but saved a fourth break point in the fourth game and fought back in emphatic fashion, punching the air after clinching the second of three match points.
In Vienna, Dan Evans progressed with a 6-4 7-6 (7-3) win against Germany’s Oscar Otte. The Brit will face Russian Karen Kachanov in the next round.
On Monday, Jack Draper was knocked out in Basel by world No 1 Carlos Alcaraz, who came back from a set down to win 3-6 6-2 7-5.
The Swiss Indoors is being held for the first time in three years after the coronavirus pandemic.