Allrounder Mehidy Hasan Miraz (5-66) bewitched the Australian batters in Darwin on the fourth day with his offspin, claiming the wickets of Alex Carey (30), Beau Webster (12) and Pat Cummins (nine) before lunch.
Allrounder Green (104) notched his third Test century in a defiant innings of class and composure as Australia were bowled out after lunch for 284 when Mehidy trapped Nathan Lyon in front.
Australia resumed their second innings at 4-161 on Sunday, but soon found themselves in strife.
It was immaculate bowling by Mehidy from around the wicket that undid Carey - floating in, drawing a defensive prod and grazing the edge for Litton Das to do the rest.
Mehidy bowled Webster with an absolute jaffa, a side-spinner that held its line and clattered into off stump. Cummins then propped to short leg as Australia lost their seventh wicket while still trailing by 21 runs.
Green, playing for his spot in the team, flicked Taskin Ahmed for two to bring up his ton, after he was dropped on 95 by the same bowler from a tough caught and bowled opportunity.
It was his first century on home soil and his first overall since making an unbeaten 174 against New Zealand in Wellington in 2024.
He drove beautifully and played the ball late, while making use of the crease well against the spinners, before chopping on to rising star Hasan Mahmud (3-66).
Australia were behind in the first Test from the outset after being bowled out for 198 on the opening day. Bangladesh took control by replying with 426 to put the hosts under pressure.