Scotland 22-20 Fiji
Scotland prop Tom Smith scored two minutes from time to book his side's place in the quarter-finals with a thrillingly tense win over Fiji.
The Scots had looked on course to miss out on the knockout stages for the first time in their history when a Nicky Little penalty put the Pacific Islanders 20-15 clear.
But, with the Fijians reduced to 14 men following the sin-binning of Api Naevo, Smith was bundled over by his forwards and Paterson converted.
Scotland move on to face Australia in the last eight.
Rupeni Caucaunibuca scored his side's only tries but, in the end, Scotland's superior fitness proved too much.
Caucau's tries separated the two sides at half-time, the first coming from a forward pass and the second - in the half's final minutes - from an impressive 50-yard sprint.
He picked the telling hole in the 13th minute, receiving a forward ball, which was not picked up by the referee, and forced his way over on the right flank.
In a half dominated by Fiji's runners it only seemed appropriate for it to end with Caucau going over again, the Auckland runner charging past two defenders for another impressive try.
Little converted both efforts, while Paterson kept Scotland in the hunt with two penalties.
It could have been worse for the Scots, who fluffed their only scoring opportunities when Andrew Henderson and James McLaren knocked on within striking distance.
Caucau had earlier come close to another score, only to lose his footing, while opposite wing Aisea Tuilevu also nearly scored, only to be forced into touch.
Paterson started the second half well by reducing the lead to five points with another penalty.
In stark contrast to the first half, Scotland spent the third quarter camped deep in the Fijian half but worryingly for them rarely looked like scoring a try.
Fijian indiscipline, however, helped Scotland's cause, allowing Paterson to kick them back into the lead.
But just when the Pacific Islanders looked to be falling by the wayside, they found themselves in front again in the 65th minute when Little sealed his first penalty of the night to set up a tense finale.
Little added another penalty to put Fiji 20-15 clear only for Smith's telling blow to follow.
Naevo was sin-binned for cynically killing the ball and, from the following forward moves, Smith forced his way over. Scotland sealed the win through Paterson's boot a moment later.
Fiji: N Ligairi; A Tuilevu, E Ruivadra, S Rabeni, R Caucaunibuca; N Little, M Raulini; J Veitayaki, G Smith, I Rasili; A Naevo, I Rawaqa; A Doviverata (capt), K Sewabu, V Maimuri
Replacements: N Seru, S Tawake, S Koyamaibole, K Salawa, J Raulini, I Nacewa, F Delasau.
Scotland: G Metcalfe; S Danielli, G Townsend, A Henderson, K Logan; C Paterson, B Redpath (capt); T Smith, G Bulloch, B Douglas; N Hines, S Grimes; R Beattie, C Mather, S Taylor
Replacements: R Russell, G McIlwham, J White, J Petrie, M Blair, J McLaren, B Hinchelwood