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 figures of five wickets for 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.
“Incredible. I just thought I had to come in and hit it hard. No chance of me coming off, great chance for the five-for,” said man-of-the-match Ball, who claimed the final wicket to wrap up the win.
“There was a bit of variable bounce. (I) hit the pitch hard, it skidded hard and changed the pace.”
‘It should have been easy’
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.
“Fantastic game. I’m stood there thinking I got the toss all wrong,” said Buttler.
“Stokesy dragged everyone together and said one last push. They were cruising it, but new batters came in. Great to continue winning habit.”
Bangladesh captain Mortaza lamented their poor catching.
“(It) should have been an easy game for us. Three hundred nine (runs) are always difficult but it was a nice wicket,” he said.
“Dropped catches cost us, (or) the score could have been 280,” he said.
The series started under tight security, with fans waiting in long queues and being patted down by policemen before entering the stadium.
Roads adjacent to the ground were kept off-limits for bystanders while security personnel were deployed around the stadium.
England’s tour, which also includes two Tests, had been thrown into doubt after an attack on a cafe in Dhaka in July that killed 18 foreigners, many of whom were hacked to death, by suspected Islamist militants.