Stokes hit 101 off 100 balls to guide England to 309-8 but it seemed not good enough as opener Imrul Kayes struck a century and shared a 118-run partnership with Shakib Al Hasan to take Bangladesh tantalisingly close to a heroic win.
With Bangladesh needing 39 off 51 balls, Ball, who finished with 5-51 runs, removed Shakib for 79 and then bowled young Mosaddek Hossain off the next ball to help England claw their way back.
Bangladesh lost all hope when leg-spinner Adil Rashid, who also played a big part in the visitors’ win with 4-49, dragged Kayes out of his crease off a wide ball for England skipper Jos Buttler to complete the stumping.
Kayes departed for 112 after facing 119 balls with Bangladesh still needing 30 runs from six overs.
Bangladesh lost their last six wickets for just 17 runs to be dismissed for 288 in 47.5 overs, handing England a 1-0 lead in three-match series.
Kayes struck 11 fours and two sixes and batted with muscle cramp since he was on 81.
He paired with Shakib after Ball and Rashid landed some early blows to leave Bangladesh on 153-4.
Stokes and Buttler, who scored 63 off 38 balls, earlier set up England’s total as the visitors recovered from 63-4 to post a competitive score after electing to bat first at the Sher-e-Bangla National Stadium.
Stokes, who hit eight fours and four sixes, was dismissed just after completing his century by nudging paceman Shafiul Islam towards midwicket for a quick single.
A miscued pull shot in the next over landed in the safe hands of Sabbir Rahman at deep-midwicket as Bangladesh skipper Mashrafe Mortaza ended Stokes’ onslaught.
Stokes, who was dropped twice by Mahmudullah and Mosharraf Hossain when he was at 69 and 71, received invaluable support from debutant Ben Duckett and the duo put on 153 runs for the fourth wicket stand.
Duckett, batting at one-down position in his first international, showed composure with 60 off 78 balls, including six boundaries.
England slowed down after the rapid departure of Duckett and Stokes but skipper Buttler kept up the momentum, taking his side past the 300-run mark.