Kirsty Gilmour is through to the quarter-finals at the European Championships but she flirted with danger before battling to a three-game 21-11 19-21 21-18 victory over Fabienne Deprez.
She now stands one win away from a medal for the second year running but it took her 58 minutes to overcome the German.
It looked like being a routine win when she took the first game 21-11 against a player she had beaten in their three previous senior meetings and then set the pace in the second.
But Deprez refused to give up and from 18-17 down took three points in a row before levelling the match on her second game point.
In the decider it was the German's turn to set the pace and she led 9-6. Gilmour stuck at it but looked in trouble when trailing 17-15 before her grit and determination produced a four-point burst to reach 19-17 and she hung on to win on her first match point.
Gilmour, the seventh seed, will now face a quarter final against France's Delphine Lansac or fourth seed Line Kjaersfeldt, the Danish player who defeated her in the final of the 2015 Scottish Open Grand Prix for a place in the semi-finals, where she would be assured at least a bronze medal to add to last year's silver.
Not that she is settling for that after a gritty display against Deprez.
Gilmour said: "It was truly a tough match. We're good friends which always make our matches something special. We have met so many times through the years that I have stopped counting.
"Last time was in February and it was obvious to me that she has improved her endurance and speed since then. I had to struggle for every single point.
"However I still feel I have the power to go for yet another three sets –not that I prefer those matches, but they are my trademark.
"I am one step closer to my goal of winning another medal and will most certainly give it my all tomorrow."
Martin Campbell and Julie MacPherson were in mixed doubles action at the end of this evening's programme after their first-round walkover on Tuesday.
But they were up against defending champions and top seeds Joachim Fischer Nielsen and Christinna Pedersen and went down 21-15 21-13.
That left Gilmour as the last Scot standing as she waits for Lansac or Kjaersfeldt.