Ibrahim Zadran plays a shot during the first ODI match at the Mahinda Rajapaksa International Cricket Stadium in Hambantota on Friday. AFP
Zadran and Rahmat Shah (55) top scored to steer the visitors to 269-4 in the 47th over after they won the toss and chose to field first in Hambantota.
Earlier Charith Asalanka top-scored with 91 to help Sri Lanka reach a below-par 268 all out after a shaky start pushed them to 84-3 inside 20 overs.
The 21-year-old Zadran was dismissed by Kasun Rajitha, who was Sri Lanka's most effective bowler on the day, and finished with 2-49 in his 10 over spell.
Zadran raced to his half-century in just 35 balls and hit 11 fours and two sixes in his innings.
Both his sixes came against rookie pacer Matheesha Pathirana, who recently made a name for himself with noteworthy performances for the latest IPL winners Chennai Super Kings.
Wayward Pathirana finished with 1-66 in 8.5 overs of his debut ODI.
Zadran and Shah anchored the Afghan innings after other opener Rahmanullah Gurbaz fell for 14 in the sixth over. Mohammad Nabi (27) and Najibullah Zadran (7) remained unbeaten at the end to steer Afghanistan to victory.
Sri Lanka's Lahiru Kumara took 1-21 in 4.3 overs as other Sri Lanka bowlers failed to make a dent.
Zadran said it was "very tough to get out" close to his fourth century and praised his bowlers for "a very good job" to restrict Sri Lanka below 300. "I wanted to finish the game and get a hundred but that's how it goes in cricket," he said after the game.
"A target of 269 was a good score, but not that challenging. The ball was coming on to that bat and we just wanted to finish things off," he added.
Earlier, a 99-run stand between Asalanka and Dhananjaya de Silva for the fifth wicket rescued the hosts. De Silva made 51 before being bowled by Nabi.
Left-arm seamer Fazalhaq Farooqi (2-58) claimed the wickets of Dimuth Karunaratne and Kusal Mendis in his opening spell, and then Fareed Ahmad and Mujeeb ur Rahman made further inroads.
After the dismissal of De Silva, captain Dasun Shanaka added 32 runs for the sixth wicket with Asalanka, but bowler Noor Ahmad accounted for the skipper with a well-disguised googly.
Dushan Hemantha backed up Asalanka well in a 48-run stand for the seventh wicket. He made 22. Asalanka scored his 91 off 95 balls with 12 fours, before being run out in the last over. Sri Lanka will use the series as preparation for World Cup qualifiers this month in Zimbabwe.
Afghanistan are already through to the sport's showpiece event this year in India and will be testing their combinations.
Set a target of 314 to win, Sri Lanka got home with two balls and four wickets in hand as Charith Asalanka starred with an unbeaten 83 off 72 balls with five fours and four sixes.
Both teams will depart for Zimbabwe at the end of the series for their World Cup qualifying campaign which begins on June 18. The all-important tournament will confirm the remaining two spots for the 10-team ICC Cricket World Cup 2023, India.
Zaman lifted Pakistan from 21-2 during a third-wicket stand of 154 off 161 balls with Mohammad Rizwan, who made a polished 74-ball 77 with six boundaries.
The second day of the 2024 Karate 1 Youth League in Fujairah was ablaze with electrifying performances as Jordanian athletes proved their mettle with three gold medals. The event resonated as a celebration of youthful talent, drawing participants from around the globe who gave their all in the quest for excellence.
The Samba Boys secured their record-breaking sixth FIFA Beach Soccer World Cup title at UAE 2024, defeating Italy 6-4 in a thrilling final at the Dubai Design District. Earlier, Iran's commendable display culminated in a resounding 6-1 victory over Belarus, securing them the bronze medal.
Half centuries by Reeza Hendricks (72) and captain Mohammad Rizwan (51) provided Multan with a strong total of 180-4 with Tayyab Tahir also contributing a meaningful 35 off 22 balls in his first game of the season after Dawid Malan fell ill.
Dhruv Jurel's 90 and a five-wicket haul by Ravichandran Ashwin put India back in the fourth Test against England on Sunday's day three, as they chase 192 for a series win. India reached 40-0 at stumps, needing another 152 in Ranchi to win their third straight match and the five-Test series.