|Samoa: (26) 33|
|Tries: T Pisi, Leiataua, Lee-Lo, Motu Matu'u Con: T Pisi, Faapale Pens: T Pisi 3|
|Scotland: (23) 36|
|Tries: Seymour, Hardie, Laidlaw Cons: Laidlaw 3 Pens: Laidlaw 5|
Scotland will play Australia in the Rugby World Cup quarter-finals after surviving an immense Samoan onslaught at St James' Park.
Captain Greig Laidlaw scored the decisive try in the final seven minutes, though the Scots had to cling on following Motu Matu'u's late score.
Samoa scored through Tusi Pisi, Ma'atulimanu Leiataua and Rey Lee-Lo in a thrilling first half.
Tommy Seymour and John Hardie crossed for the Scots before the break.
Scotland also had Ryan Wilson sin-binned in the first half for stamping.
The Wallabies beat the Welsh 15-6 at Twickenham and will now face Vern Cotter's Pool B runners-up, with South Africa having already won the section.
Same old Scotland
All week Scotland had spoken of their need to get out of the blocks a whole lot quicker than they have done so far in the tournament. They didn't. They were an unmitigated shambles. Incredibly slow at re-starts, passive in the tackle, hugely vulnerable out wide and beaten in all parts of the pitch.
Samoa were thunderous and clever and accurate and Pisi, Leiataua and Lee-Lo crossed with aplomb. Scotland were bullied. At the break they were in trouble. Big trouble.
Seymour intercepted almost on the try line to touch down after Pisi's opener and Hardie forced his way over after the Samoans' third score, with Laidlaw's kicking keeping the Scots in touch.
Same old Samoa
Scotland brought a better physicality in the second half. Better scrum, better attitude. Just. Under pressure, Samoa reverted to type and conceded penalty after penalty.
Their indiscipline in the heart of the battle was horrific. Quite how they avoided a yellow card is a mystery.
That, combined with a solid scrum from Scotland, created the platform for Laidlaw's pivotal score. Even then, there were monstrously fretful moments, with Matu'u bustling over soon after.
But Scotland survived and move on to the last eight for the first time since 2007.
Scotland head coach Vern Cotter said the match had been about "winning and fighting for a win".
"If anyone thought it was going to be an easy game, after the first five minutes, we certainly got a taste of what was coming at us," he said.
"We found ways into the game and I thought the forwards stepped up and played well. I'm really, really happy for them."
- This was the second highest scoring game at this year's World Cup after New Zealand 58-14 Namibia.
- Greig Laidlaw scored 26 points - his best ever haul in a single Test for Scotland.
- Tommy Seymour has scored in his last four Tests. Only four Scots (Alec Purves with six and Johnny Wallace, Gregor Townsend and Martin Leslie with five) have scored a try in more consecutive Tests.
- Samoa had not scored more than two tries in any of their previous six Rugby World Cup matches. They scored four, including three in the first 20 minutes.
- There were seven tries scored. In the nine previous Tests between the two nations there had never been more than five.
Samoa: T Nanai-Williams, P Perez, G Pisi, R Lee-Lo, F Autagavaia, T Pisi, K Fotuali'i; S Taulafo, M Leiataua, C Johnston, T Paulo, Kane Thompson, M Faasavalu, J Lam, A Faosiliva. Replacements: M Matu'u, V Afatia, A Perenise, F Levave, V Tuilagi, V Afemai, P Faapale, K Pisi.
Scotland: S Hogg, S Maitland, M Bennett, M Scott, T Seymour, F Russell, G Laidlaw; A Dickinson, R Ford, WP Nel, R Gray, J Gray, R Wilson, J Hardie, D Denton. Replacements: F Brown, G Reid, J Welsh, T Swinson, J Strauss, H Pyrgos, P Horne, S Lamont.
Sin bin: Wilson (28).
Referee: Jaco Peyper (South Africa).