Australia made a good start to Day 3, as Nathan Lyon picked two early wickets - of Taijul Islam and Imrul Kayes.
Tamim Iqbal drove Bangladesh ahead with a fine half-century.
Tamim
Mushfiqur Rahim made a vital contribution as Bangladesh pushed their lead further.
Nathan Lyon spun a web around Bangladesh in the second session, as the hosts fell from 186 for 5 to 186 for 8.
Mehidy Hasan played an late cameo to frustrate the Aussies and took the lead past 250
Nathan Lyon bagged his 10th Test five-fer and went on to pick his sixth as Bangladesh folded for 221 in the final session, setting Australia a target of 265.
In chase of 265, Australia made a shaky start as David Warner stuttered against turn and Matt Renshaw fell early
Shakib Al Hasan and David Warner had a little staring contest going on between them.
After Renshaw and Usman Khawaja departed, Warner took centrestage.
Warner went on to score a half-century and remained unbeaten on 75 at stumps.
Warner and Smith added an unbeaten 81-run partnership for the third wicket as Australia finished on 109 for 2, needing 156 more to record a memorable win.