Cook’s side went into the final morning needing two Bangladesh wickets for a series-opening win but knowing that the hosts were only 33 runs away from what would have been a historic upset.
Stokes ensured that was not the case by having both Taijul Islam and Shafiul Islam trapped lbw in the space of three balls.
The 25-year-old had already taken four for 26 in the first innings and scored a mature 85 from 151 balls to ensure England left a testing victory target of 286, which proved tantalisingly out of Bangladesh’s reach.
Cook said: “It’s not just ball in hand, it’s the way he’s batted. He balances the side.
“It allows us to play the extra seamer in these conditions.
“These cricketers don’t come around very often. He might have a lot of skill and all that talent but he’s got enormous heart as well.
“You try and take the ball off him and saying we’ll bowl short spells and he wants to bowl seven or eight (overs). So he can be a bit of a handful to captain that way but I’d rather have him that way - he’s a seriously good cricketer.”
Cook also praised Bangladesh after a thrilling contest reached a suitably nerve-shredding climax on a pitch that offered plenty of turn from the start.
“It was a really good Test match - I didn’t think that we’d be here on day five looking at that wicket,” he added.
“In one way it’s sad that there has to be a loser because it was such a tight game. Credit to both sides.
“I’m really happy that we showed the character to hold our nerve towards the end and the quality we have, certainly in our seamers with reverse swing, I was confident we’d make enough chances.”
After Stokes picked up his man of the match award he insisted his performance must become a benchmark for the rest of the winter, with England following the second game in Dhake with five Tests in India.
“It’s a long winter from here,” he said. “Hopefully this is just a starting point.
“Hopefully I can start putting in some more performances with bat and ball on a more consistent basis.”
Bangladesh captain Mushfiqur Rahim praised his side despite missing out on what would have been only their eighth - and by far their most famous - Test victory.
“The boys really showed their character - they fought really hard the last few days,” he said.