Scotland will play Ireland in the ICC World Cricket League Division One final after securing a nervy two-wicket win over Afghanistan in Rotterdam.
Victory for either side would have sealed their place in Saturday's decider and Scotland grabbed the initiative when they bowled out their Asian rivals for just 141.
Scotland then suffered a late-order collapse, after opener Fraser Watts had set them on course with a patient 46, before they snuck home by two wickets with 37 balls to spare.
Watts and Neil McCullum had looked to have the chase under control as they progressed to 105-3 in the 32nd over.
McCullum had anchored the innings with 19 from 51 balls, but undid his good work when he was stumped by Mohammad Shahzad off the bowling of Mohammad Nabi.
Watts then followed four short of his half-century shortly after, and Scotland found themselves unnecessarily relying on their tailenders as they lost five wickets for 37 runs.
Number 10 Gordon Goudie eventually eased his side's nerves when he pushed a single through the infield to leave Afghanistan wondering what might have been but for the 19 wides they conceded.
Earlier, Scotland's slow bowlers Ross Lyons and Moneeb Iqbal inspired an Afghanistan collapse after Goudie had claimed two early wickets.
Goudie removed Karim Sadiq (two) and Javed Ahmadi (three) inside the opening five overs, before Afghanistan's middle order showed greater resistence to progress to 98 for four.
But the introduction of Lyons (3-21) and Iqbal (2-35) sparked a collapse of six wickets for 43 runs to end the Afghanistan innings prematurely.