Neil McCallum's century saved Scotland from total collapse on the opening day of the ICC Intercontinental Cup final with Afghanistan in Dubai.
McCallum struck 104 not out off 221 balls and featuring 17 fours, but only two other batsmen made double figures in Scotland's 212 all out, with Richie Berrington and wicketkeeper Simon Smith hitting 29 and 36, respectively.
Smith's knock came in a ninth-wicket century stand, before Matthew Parker took the wicket of Shabir Noori to leave Afghanistan 18-1 at stumps, 194 runs behind, after four overs of their reply.
Scotland and Afghanistan met in the five-day game, which will determine the best non-playing Test nation, after qualifying for the final as the two leading nations following a seven team round-robin event.
Scotland were seeking to reclaim the title they won in the inaugural edition in 2004 and captain Gordon Drummond won the toss and elected to bat.
Afghanistan beat Scotland by 229 runs in Ayr in August after a first-innings collapse and Scotland were on course for a similar defeat before McCallum came to the crease.
Preston Mommsen was out for three in the fifth over and his fellow opener Fraser Watts (five) followed six balls later.
Kyle Coetzer was out for a duck in the ninth over, leaving Scotland reeling on 19-3.
McCallum joined Berrington in the middle to put on 32 runs for the fourth wicket before his partner perished caught behind.
McCallum then watched as Scotland fell from 51-4 to 97-8, with Gregor Maiden (three), Parker (nine), Majid Haq (six) and Drummond (three) all returning to the pavilion.
But a 107-run ninth-wicket stand between McCallum and Smith restored credibility.
Once wicketkeeper Smith was out, Afghanistan swiftly mopped up the Scotland innings, leaving McCallum unbeaten after watching his team crumble around him.
Hamid Hassan finished with five for 45 for Afghanistan, with Mirwais Ashraf taking three wickets and Shapoor Zadran two.
Four overs remained in the day for Afghanistan to bat, with Parker removing Noori in the third over, leaving Karim Sadiq and Ashraf unbeaten on two and five, respectively, at the close.