Opener Ibrahim Zadran led Afghanistan's batting with a sparkling century as the tourists reached 294-8 against Sri Lanka in the first of the three one-day internationals on Friday.
Ibrahim made 106 and put on key partnerships including a 118-run second-wicket stand with Rahmat Shah, who made 52, to lay the foundations of the challenging total in Pallekele.
Najibullah Zadran's 25-ball 42 boosted the total but some disciplined bowling in the end checked Afghanistan, who looked like reaching over 300.
Wrist-spinner Wanindu Hasaranga returned impressive figures of 2-42 in his 10 overs.
Afghanistan, led by Hashmatullah Shahidi, elected to bat and Rahmanullah Gurbaz justified the decision with a flurry of boundaries as he made 53.
Ibrahim soon joined the attack as the two put on 84 runs to set the tone for the batting domination.
Gurbaz, who survived a dropped catch on 13, reached his fifty with a boundary but fell to Hasaranga in the next over.
Ibrahim and Shah then got going in their century stand, which survived a run-drought in the middle overs to once again take the attack to the opposition bowlers.
Shah departed after his fifty but Ibrahim, playing just his sixth ODI for Afghanistan, went on to register his second hundred in the format with a boundary off Lahiru Kumara.
He finally fell to Maheesh Theekshana's mystery spin as he attempted another big hit but got caught at long-on. Ibrahim hit 11 boundaries in his 120-ball knock.
Cameos from Najibullah and Gulbadin Naib, who made 22 off 24 balls, took on the bowlers but Sri Lanka gave away just 31 runs in the final five overs and took five wickets.