DHAKA: The hosts resumed on 193 for three after a turgid first day and Tamim and Shakib's partnership of 132 helped provide them with a solid base to post a first-innings total of 433.
The tourists then made a solid start to their reply to move to 53 for one, trailing by 380 runs with nine first-innings wickets remaining.
Shakib and Tamim began the day with more patient play before the former launched part-time spinner Malcolm Waller's first ball of the day over long-on for six.
Shakib then brought up his 50 off 71 balls, but the big moment was to come 10 balls later as Tamim brought up his first Test century since scoring 108 at Old Trafford in June 2010.
The 25-year-old thumped a Natsai M'shangwe delivery for four to bring up his ton in a watchful 312 balls.
Shakib thumped Waller for another maximum, but the fourth-wicket partnership was ended two overs before lunch when Tamim went chasing a Hamilton Masakadza delivery and Craig Irvine took a catch at gully.
The resurgent opener's 109 came in 332 balls after a 473-minute stay at the crease.
Mushfiqur Rahim replaced him, but was gone for just 11 as he and Shakib went looking for a single and Sikandar Raza's direct hit did the damage.
Shakib ended his own three-figure drought, he had not scored a century in nine matches since December 2011, with a straight-driven four off his 153rd ball from Tinashe Panyangara.
But Waller claimed revenge for his two earlier clobberings off the 27-year-old when he removed him for 137 off the first ball of the 142nd over.
Shakib was looking to go big again, but missed the ball which went on to take out middle stump and end his 180-ball stay.
Shuvagata Hom was next to go as he became Waller's second victim with Brian Chari taking the catch at deep midwicket to remove him for 15.
Tea was taken at 406 for seven, but, when Taijul Islam (32) was caught by Masakadza off Tendai Chatara to make it 426 for eight, Shahadat Hossain (18) and Jubair Hossain (one) fell soon after.
Chari came out alongside Raza to open the innings on his Test debut and got off the mark off the final ball of the third over.
And three overs later he had lost his partner for 11 lbw to Taijal, with the decision being upheld due to umpire's call after review.
Chari (21 not out) and Masakadza (15 not out) then made it safely through to the close.
On October 27, Bangladesh won the first Test match by three wickets at Sher-e-Bangla National Stadium in Mirpur, Dhaka.
Bangladesh team:
Tamim Iqbal, Shamsur Rahman, Mominul Haque, Mahmudullah, Shakib Al Hasan, Mushfiqur Rahim*†, Shuvagata Hom, Taijul Islam, Shahadat Hossain, Rubel Hossain and Jubair Hossain.
Zimbabwe team:
Sikandar Raza, B Chari, H Masakadza, BRM Taylor*, MN Waller, CR Ervine, E Chigumbura, RW Chakabva†, T Panyangara, N M'shangwe and TL Chatara.
Source: Eurosport
** Shakib, Tamim ton helps Tigers score 331/5
** Shakib, Tamim tons build strong base
BDST: 1840 HRS, NOV 04, 2014