Scotland made 325 for seven from their 50 overs with Calum MacLeod hitting 100 and captain Kyle Coetzer supporting him with 79.
Afghanistan reached 269 for three with 31 balls remaining when rain forced the players off the field and they were eventually declared the winners on the Duckworth-Lewis-Stern method.
Hashmatullah Shahidi finished with an unbeaten 59 while opener Mohammad Shahzad hit 55.
The first match that was scheduled for Wednesday was called off without a ball being bowled because of rain.
Afghanistan are one of just 10 teams taking part in the World Cup which gets underway in England and Wales on May 30.
Scotland 325 for 7 (MacLeod 100, Coetzer 73) v Afghanistan 269 for 3 (Rahmat 113, Hashmatullah 59 not out, Shahzad 55).
Afghanistan won by two runs (DLS method)