Scotland squeezed into the quarter-finals of the Rugby World Cup with a 36-33 win over Samoa in Newcastle this afternoon.
The first half was played at a breakneck speed as both sides ran the ball with confidence, but also committed plenty of mistakes when defending.
Tusi Pisi and Greig Laidlaw kicked a penalty each in the early stages before three tries were scored in as many minutes before the quarter-hour mark.
Fly-half Pisi did well to touch down in the corner and then convert his own try from the touchline before Scotland hit straight back through Tommy Seymour, who pounced on a risky Samoan pass at the back to go over.
Both sides were looking extremely dangerous when they got the ball, and Samoa scored instantly from kickoff to restore their lead as Manu Leiataua, on his World Cup debut, scored his first international try.
Laidlaw cut the gap with a second penalty kick, but Scotland simply could not handle the pace of Samoa's backline as Reynold Lee-Lo scored a third Le Manu try at the midway point of the opening 40.
Pisi failed to split the posts with his conversion attempts for the second and third Samoan tries, but Laidlaw was proving more consistent with the boot as he reduced the deficit to four.
Scotland flanker Ryan Wilson was sin-binned for a stamp in the 29th minute and Pisi kicked the penalty, but Scotland were back on level terms despite being a man down when John Hardie powered over after a strong driving maul.
The Dark Blues did go in behind at the break, though, due to a Pisi penalty after Samoa had a fourth try of the half ruled out due to an infringement on Laidlaw.
At the start of the second period Scotland were all over their opposition and they turned down several kicks at goal as they chased a try, but they couldn't find a way through and eventually Laidlaw settled for the posts to level the match once more.
Moments later he put the Scots in front with another penalty, becoming the tournament's leading scorer in the process, but then missed two further kicks at goal which would have put Scotland nine ahead.
The first half was the highest-scoring of any at this year's tournament, but the second was much tighter as the game became a stop-start affair.
Scotland knew that they had to pull away going into the closing stages and, after a sustained spell of pressure, it was captain Laidlaw who took it upon himself to drive over the line and put the Dark Blues 10 in front.
Samoa had no chance of reaching the last eight, but they didn't give up and made it an extremely nervy finale as substitute Motu Matu'u scored his first international try to cut the lead to three points.
Le Manu got the ball back at the restart, but Scotland managed to secure a turnover and whittled down the clock before kicking into touch to send the packed house inside St James' wild.
Victory guarantees Scotland second place in Pool B and they will face the winner of this afternoon's second match between Australia and Wales in the last eight.