SOFIA (Reuters) - Stan Wawrinka, looking to play himself back into form after a long layoff due to a knee surgery, survived a scare to advance to the Sofia Open quarter-finals with a 4-6 6-2 6-3 win over Slovakian qualifier Martin Klizan on Thursday.

After losing the opening set, the 32-year-old three-times grand slam champion piled on the pressure with rasping baseline winners and wrapped up victory showing no ill-effects from the injury that hampered him at the Australian Open last month.

The burly Swiss’s powers of recovery will be put to the test on Friday when he meets 2016 runner-up Viktor Troicki. The Serb progressed to the last eight by beating Uzbek Denis Istomin 7-6(4) 1-6 7-6(5).

“I knew it will be tough match against a tough opponent. It was my just third match after last year at Wimbledon,” Wawrinka told a news conference.

“So I need matches, I need tournaments, I need confidence. My level fitness-wise is not yet at my top, but I was surprised I was playing good. I am really proud with the way I was fighting.”

Marcos Baghdatis upset second seed Frenchman Adrian Mannarino 6-7(4) 6-3 6-1.

The feisty Cypriot, who will meet Slovakian qualifier Jozef Kovalik for a place in the semis, broke twice in the decisive set, leaving his 29-year-old opponent to hurl his racket to the court.

Third seed Gilles Muller needed all his experience to dig himself out of trouble and beat Italian Andreas Seppi 4-6 7-6(5) 7-6(2) in the longest match of the tournament to reach the quarter-finals in Sofia for a third consecutive year.

The 34-year-old left-hander from Luxembourg clawed his way back into a match lasting two hours and 35 minutes after powering down 23 aces to set up an intriguing clash with big-serving Romanian Marius Copil, who breezed past Slovenia’s Blaz Kavcic 6-2 6-2.