The hosts reached 133-3 at lunch to lead Australia by 176 runs on a turning pitch at Dhaka's Sher-e-Bangla National Stadium.
Tamim, who made 71 in the first innings, was 76 not out at the break after Bangladesh resumed play on 45-1.
Skipper Mushfiqur Rahim was on 25 at the interval, with Bangladesh seeking their first-ever win over Australia in what is only their fifth meeting in a Test.
Off-spinner Nathan Lyon took both the wickets to fall in the morning, trapping nightwatchman Taijul Islam lbw for four and forcing Imrul Kayes to edge a catch to David Warner at second slip for two.
More From This Section
Tamim, unbeaten on 30 overnight, struck Pat Cummins for two fours in the first over of the day before surviving a strong lbw appeal at 42.
Australia reviewed the not out decision by on-field umpire Aleem Dar but in vain.
The left-hander dispatched Ashton Agar to backward point for four to complete his second fifty of the game off 109 balls.