Scotland captain Bryan Redpath breathed a sigh of relief after his side scraped through to the last eight of the World Cup with a 22-20 victory over Fiji.
Scotland trailed 14-6 at half-time after two first-half tries from Fiji winger Rupeni Caucaunibuca.
But a try from prop Tom Smith two minutes from time allowed them to preserve their record of reaching the quarter-finals at every World Cup.
"It was very close. It shows you have to dig deep in games like these," said Redpath.
"But credit for Fiji, they got two chances in the first half and that man Caucau just killed us.
"When there were any turnovers they got the ball out to the danger man, and he is one of the best wingers around.
"Fiji were exceptional. We lost our rhythm at certain times. We need to keep possession longer and work defences harder - and if we do you never know."
Redpath admitted Scotland would not be expected to stand a chance if, as expected, they face Australia in the last eight.
"We will be huge underdogs and Australia are a class act but we have nothing to lose and we have got to make sure we throw everything at them," he added.
Chris Paterson, who was switched from the wing to fly-half for the game, contributed 17 points with the boot and played a key role in steadying the ship for Scotland.
"It was too close," said Paterson. "The team has been under massive pressure this week.
"We were almost written off entirely by everyone except ourselves and our supporters but we look forward to staying here for another week at least.
"The start Fiji made was something special. We're thoroughly delighted not to be going home."