Prasidh Krishna recorded a career-best 5/23, decimating Afghanistan's top-order early in the match.
Afghanistan captain Hashmatullah Shahidi scored a valiant maiden ODI century of 102 runs.
Crucial partnerships with Azmatullah Omarzai and Mohammad Nabi helped Afghanistan reach a total of 218.
The tourists were handed a five-run penalty due to Shahidi running on the pitch's danger zone.