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.
Scorecard
Pakistan Innings
A. Ali c Rahim b Al Hasan 36
S. Ahmed c Sarkar b R. Hossain 7
M. Hafeez b A. Sunny 0
H. Sohail c&b Mortaza 44
F. Alam b Nas. Hossain 0
M. Rizwan lbw b Al Hasan 13
S. Nasim not out 77
W. Riaz not out 51
Extras (b-2 lb-2 nb-2 w-5) 11
Total (for 6 wickets, 50 overs) 239
Fall of wickets: 1-36, 2-37, 3-58, 4-59, 5-77, 6-154
Bowling
M. Mortaza 8 - 0 - 52 - 1(nb-1)
T. Ahmed 8 - 1 - 41 - 0(w-1)
A. Sunny 10 - 0 - 41 - 1(w-1)
R. Hossain 7 - 2 - 27 - 1(nb-1 w-1)
N. Hossain 5 - 0 - 17 - 1(w-1)
S. Al Hasan 10 - 0 - 51 - 2
M. Mahmudullah 2 - 0 - 6 - 0(w-1)
Bangladesh Innings
T. Iqbal not out 116
S. Sarkar c S. Ahmed b J. Khan 17
M. Mahmudullah b Ajmal 17
M. Rahim c Alam b R. Ali 65
S. Al Hasan not out 7
Extras (lb-2 nb-1 w-15) 18
Total (for 3 wickets, 38.1 overs) 240
Fall of wickets: 1-22, 2-100, 3-218
Bowling
J. Khan 9 - 0 - 61 - 1(w-4)
R. Ali 7 - 0 - 57 - 1(w-2)
W. Riaz 8 - 0 - 36 - 0(nb-1 w-3)
S. Ajmal 9.1 - 1 - 49 - 1(w-1)
A. Ali 3 - 0 - 20 - 0(w-1)
S. Nasim 2 - 0 - 15 - 0
Image: Tamim Iqbal
Photograph: Robert Cianflone/Getty Images
WATCH LIVE: Land bill creates ruckus in Lok Sabha
This is suit-boot ki sarkar: Top quotes from Rahul's speech
3 Body Jewellery Pieces That You Didn't Know Even Existed