After restricting Pakistan to a modest 239 for six, the hosts returned with Tamim, who had scored 132 in his team's victory in Friday's series opener, leading their successful chase with nearly 12 overs to spare.
Chasing 240 to clinch the three-match series, Bangladesh lost opener Soumya Sarkar in the third over but Tamim dominated a 78-run stand with Mahmudullah (17) to keep the hosts firmly on track.
Saeed Ajmal removed Mahmudullah in the 15th over but that brought in Mushfiqur Rahim (65) and the stumper-batsman proved a perfect foil for the left-handed Tamim as they added 118 runs to take Bangladesh close to their target.
Tamim glanced Junaid Khan for a boundary to bring up his sixth ODI century and remained unbeaten after a run-a-ball 116 that included 17 boundaries and a six.
Pakistan fielded the same side who went down by 79 runs on Friday, their first ODI defeat by Bangladesh in 16 years, and once again they disappointed their fans.
New one-day captain Azhar Ali's decision to bat first at the Shere Bangla National Stadium backfired
with the tourists losing the top half of their batting order by the 22nd over.
Ali notched 36 runs but Bangladesh made early inroads to reduce Pakistan to 77 for five before Harris Sohail (44) and Saad Nasim propped up the innings with a 77-run stand.
Nasim, who scored a duck in his ODI debut on Friday, remained not out on 77 and it took Wahab Riaz's late blitz to lift Pakistan to a decent 239 for six.
Riaz was unbeaten on 51 off 40 balls as he and Nasim scored 49 from the last five overs.
Both teams are set to return to the ground for the third and final match on Wednesday.

Latest News from Sports News Desk