Australian cricket player Nathan Lyon (R) celebrates with teammates after the dismissal of Bangladeshi cricketer Tamim Iqbal during the fourth day of the second cricket Test between Bangladesh and Australia at Zahur Ahmed Chowdhury Stadium in Chittagong on September 7, 2017. / AFP PHOTO / Munir UZ ZAMAN (Photo credit should read MUNIR UZ ZAMAN/AFP/Getty Images)

Australia has won the second Test in Chittagong by seven wickets, dodging an embarrassing defeat to Bangladesh in the two-match series.

Nathan Lyon saved the day by producing one of the all-time greatest individual bowling performances. Lyon backed up his seven wicket haul in the first innings to record career best match figures of 13-154, eclipsing Shane Warne's record of 12-for figures.

The 13-wicket haul was just one wicket shy of the greatest figures in Test cricket, by Aussie spinner Clarrie Grimmett with 14 wickets. Lyon also now tops the charts for the most wickets taken by any bowler in 2017, a solid statistic to hold onto ahead of the upcoming Australian summer cricket season.

the Aussies claimed victory on Thursday in the 16th over of their second innings and with a day to spare, with a set target of 86 runs to win after bowling out Bangladesh for 157 in their second innings on day four.

Glenn Maxwell (25 not out) and Peter Handscomb (18 not out) powered the side home with some big strokes in the dying overs of day four. Maxwell finished the job with a huge six over mid-wicket.

But the Test was not all smooth for the Aussies, there were some nervous moments during their run chase with David Warner and Steve Smith both falling cheaply.

Warner (eight) was caught at deep square leg while attempting to pull a short delivery from paceman Mustafizur Rahman.

Smith (16) was caught by left-arm spinner, Taijul Islam, to cap off his underwhelming start. If Australia had lost the series 2-0, it would have dropped their ranking to No.6 in the world, their lowest point in almost 30 years.

An innings victory looked more possible when Bangladesh collapsed to 5-43 before lunch on day four.

Mushfiqur and Haque (29) did their best to keep the hosts in with a chance but Musfiqur departed on 31 when Pat Cummins caught him behind. Mushfiqur is also likely to come under scrutiny from match officials after angrily confronting umpire Ian Gould before lunch.

The deteriorating pitch proved to be a blessing for Australia as it gave Lyon the ability to exploit it with plenty of turn.

Matthew Wade made an important contribution as wicket keeper, stumping Tamin Iqbal (12) and Shabbir Rahman (24) both off Lyon's bowling. When Wade was called up last summer, the biggest concern was his wicket keeping, not his batting. Heading into this summer the opposite is true.

Australia were earlier bowled out for 377 in their first innings, with the visitors unable to add to their 72-run overnight lead after resuming with one wicket in hand.

With no more Test cricket to play before summer, it looks like it will come down to the Sheffield Shield form to determine who gets the nod at No.6 come the Ashes.