Wickets continued to tumble on day two of the ICC Intercontinental Cup final in Dubai, Scotland reaching stumps on 64-6 in their second innings, a lead of 105.
Afghanistan had earlier crumbled to 171 all out, including three wickets apiece for Matthew Parker and Majid Haq, to hand Scotland an advantage of 41 on first innings.
Resuming on 18-1, Afghanistan enjoyed a 41-run second-wicket partnership which was ended when Haq removed Mirwais Ashraf caught behind for 21.
Afghanistan made strong starts in partnerships but could not build on them.
Opener Karim Sadiq was out for 43 and Mohammad Shahzad (10) followed, both to Richie Berrington, leaving Afghanistan 89-4.
Nawroz Mangal and Asghar Stanikzai shared in a stand of 43 before the latter was out, becoming Haq's second victim.
Afghanistan then crumbled with Mangal the only player showing any resistance.
Mohammad Nabi (1), Mangal (56), Samiullah Shenwari (4), Hamid Hassan (nought) and Shapoor Zadran (nought) were out as Afghanistan fell from 139-5 to 171 all out.
Berrington and Ross Lyons finished with two wickets each.
Scotland's 41-run first-innings advantage soon looked like it may not be enough as they slumped to 55-5.
Preston Mommsen was out for nine in the eighth over and Fraser Watts (28) followed before Scotland lost three wickets without adding to their score.
Kyle Coetzer was run out for 11, Gregor Maiden (4) caught and first-innings saviour McCallum (0) caught behind.
Parker and Berrington attempted to restore stability and occupy the crease.
But Parker faced 27 balls without scoring before being bowled by Hassan, leaving Berrington to resume tomorrow with captain Gordon Drummond.
Hassan finished the day with two wickets, while Shenwari had 3-15.