Scotland took their Intercontinental Cup tie with Afghanistan into a third day - but only just.
The have just one wicket remaining in their second innings and yet still trail by six runs.
The Scots, who were bowled out for 125 on the first day, finished the second on 144 for nine in Abu Dhabi after Afghanistan had racked up a 150-run lead following their first innings.
The Afghans started the day on 150 for four and Rahmat Shah's unbeaten 67 on his first-class debut helped them to 275, with Josh Davey taking four wickets.
Scotland needed something special in their second innings but Davey was caught for seven in the third over and, although fellow opener Kyle Coetzer hit 57, including 12 boundaries, their aim soon became to avoid an innings defeat.
Izatullah Dawlatzai took five wickets, taking his tally for the match to 11, and that including the scalp of Coetzer.
Scotland needed the resilience of captain Gordon Drummond (16 not out) and Safyaan Sharif (10 not out) to see them to the end of the day.