Bowlers set up the win for Afghanistan as leg-spinner Rashid Khan took 3-35 and Mohammad Nabi claimed 2-16 to help the visitors dismiss Bangladesh for a modest 208 runs on a slow pitch at the Sher-e-Bangla National Stadium.
Man-of-the-match Nabi showed his all-round skill scoring 49 runs and putting on 107 runs with Stanikzai in the fifth wicket as Afghanistan recovered from 63-4 to reach 212-8, completing their second win against Bangladesh in four meetings.
Stanikzai hit four fours and two sixes in his 95 balls to atone for some of his causal batting in the opening match, which saw Afghanistan lose by seven runs despite dominating Bangladeshi bowlers for a long period.
Defending a modest score, Shakib Al Hasan gave Bangladesh some hope with three early wickets before finishing with 4-47, but Nabi and Stanikzai stood firm to put Afghanistan in a strong position.
Mashrafe Mortaza trapped Nabi leg-before to end their partnership before debutant Mosaddek Hossain, who claimed 2-30, including one off his first ball, removed Stanikzai.
But Najibullah Zadran made 22 and other lower-order batsmen gave him valuable support to see Afghanistan home, setting the third and final match on October 1 as the series decider.
Stanikzai hailed his bowlers for their brilliant effort.
“This match, the credit goes to the team. Nabi and Rashid bowled really well,” he said.
“The ball reversed in the end, but Najib did it for us.”
Earlier, Bangladesh could only pass the 200-run mark owing to an unbeaten 45 runs of Mosaddek, who shared 43 runs with Rubel Hossain in the last wicket pair.
Put into bat first, Bangladesh, who were looking for their 100th ODI win and to wrap-up the series after winning Sunday’s first match by a narrow seven runs, made a cautious start with the opening pair fetching 45 runs.
Mirwais Ashraf, who claimed 2-23, removed both the openers Tamim Iqbal (20) and Soumya Sarkar (20) before Mushfiqur Rahim and Mahmudullah Riyad revived the innings, adding 61 runs for the third wicket.
Afghan spinners took control of the proceedings once Naveen-ul-Haq bowled Mahmudullah for 25.
Rahim, who scored 38, soon followed Mahmudullah attempting his favourite slow-sweep as Naveen-ul Haq took the catch at deep square leg off leg-spinner Shah.
Nabi trapped Shakib Al Hasan leg-before for 17 before Rashid worked out the lower order.
Bangladesh captain Mortaza lamented their poor batting.
“(Our) batting wasn’t up to the mark. The wicket was on the slow side, and after getting 20-30 runs, somebody should have made a good score,” he said.