There was potential for a surprise in this Super 10 Group 1 game with Sri Lanka having lost 10 of their last 12 T20s, including two warm-up matches in India.
Afghanistan, by contrast, came through last week’s qualification with three wins from three.
When captain Stanikzai’s 62 from 47 balls aided a score of 153 for seven at Eden Gardens in Kolkata, the Afghans had a dependable total.
They chipped away at Sri Lanka throughout the reply to keep the result in the balance until late on, but Dilshan used his experience and flare to seal a six-wicket victory with 83 not out in 56 deliveries.
Both teams await England next week after Eoin Morgan’s men face South Africa tomorrow.
England may hope Sri Lanka paceman Lasith Malinga is still missing, as he was today due to a knee injury.
Having chosen to bat first, Afghanistan made a slow start and lost Mohammad Shahzad in the powerplay when he miscued an attempted heave to mid-on.
It got worse for the Afghans after the powerplay as they lost three wickets in consecutive overs: Rangana Herath bowled Noor Ali Zadran round his legs; Karim Sadiq, also attempting a heave, edged Thisara Perera behind; and Herath pinned Mohammad Nabi lbw to make it 51 for four from 11.
However Stanikzai resisted with two successive sixes off Milinda Siriwardana, bringing a supportive crowd to life.
Stanikzai soon hit Herath for two maximums in three balls, Lahiru Thirimanne dropping the first over the midwicket rope.
Samiullah Shenwari followed his skipper’s lead with back-to-back fours off Thisara before slogging Nuwan Kulasekara for six but immediately holing out to long-off as the seamer claimed 3-33.
Next ball Stanikzai survived when skipper Angelo Mathews could not hold on at cover, seemingly losing the ball in the floodlights.
With the overs ticking down, Stanikzai launched Thisara over long-on for his fourth maximum. But later in the over Shafiqullah holed out to deep midwicket and Stanikzai miscued an attempted scoop to end his stay.
It was left to Najibullah Zadran to strike Kulsasekara consecutively for four and six over cover in the innings’ last over.
Opening alongside Dilshan, Dinesh Chandimal set the pace with two successive boundaries off Karim Sadiq in the first over.
Dilshan soon twice copied the trick, initially with a pair of sixes including his trademark Dilscoop.
Nabi struck inside the powerplay, which yielded 41 runs, forcing Chandimal to lob a catch to midwicket in a wicket-maiden. Thirimanne soon played on to Rashid Khan.
In response powerful Thisara was promoted to number four but managed just one six before being run out.
Shortly afterwards Dilshan raised his 12th T20 international fifty (in addition to one hundred) and continued to advance with a maximum off Hamid Hassan.
Chamara Kapugedera was unfortunate to become a second run-out victim. He backed up too far as Nabi touched the ball in his follow-through.
Yet late hitting from Mathews aided a win completed by Dilshan swatting Hassan to the midwicket fence with seven balls to spare.