Paceman Doug Bracewell finished with 6-40 as Australia was dismissed for 233 chasing 241 to win, losing its last eight wickets for 74 runs.
The Australians were coasting at 159-2 before slumping to 199-9. [break]
Bracewell took three key wickets in two overs just before lunch and then another two in one over as Australia lost four wickets in 10 balls at the start of the middle session.
Opener David Warner carried his bat in an unbeaten 123, but his maiden test hundred was overshadowed by another Australian batting failure that will almost certainly cost opener Phil Hughes his spot and raises even more questions over the test futures of veterans Ricky Ponting and Mike Hussey.
The series finished 1-1 after Australia won the opener by nine wickets.
Bangladesh facing New Zealand today