Shakib Al Hasan, third left, celebrates with his teammates after taking five wickets against Australia in Dhaka. Photo: A.M. Ahad, AP

DHAKA – Shakib Al Hasan claimed five wickets to help dismiss Australia for 217 and give Bangladesh the upper hand on the second day of the opening Test on Monday.

Australia, who resumed the day on a precarious 18/3, were bowled out early in the final session for 217 to hand the hosts a 43-run first-innings lead.

By stumps, they had increased that to an 88-run advantage for the loss of one wicket.

Shakib, who finished with 5/68 and also top-scored in Bangladesh’s first innings with 84, was ably supported by off-spinner Mehedi Hasan.

Mehedi claimed 3/62, including the prized scalp of skipper Steve Smith for eight.

“By grace of Allah the match is in our hand. Hopefully we will also do well tomorrow,” said Mehedi, a practising Muslim. “If our batsmen take responsibility and put a good total, it will be challenging for them. I don’t think the wicket is very difficult. But we bowled well.”

Australian captain Steve Smith walks back to the pavilion after his dismissal by Bangladesh's Mehedi Hasan Miraz. Photo: A.M. Ahad, AP

The hosts reached 45/1 at stumps in their second innings, with opener Tamim Iqbal on 30 and nightwatchman Taijul Islam yet to score.

Slow left-armer Ashton Agar ended a confident 43-run opening stand when he had Soumya Sarkar (15) caught by Usman Khawaja at long-on after several attempts.

Australia also had Agar to thank for helping get them close to Bangladesh’s first-innings total of 260 after their regular batsmen struggled against spin.

Agar, batting at number nine, made an unbeaten 41 and shared a crucial stand of 49 with Pat Cummins, taking Australia past the 200 mark after Shakib and Mehedi had the visitors on the ropes.

Agar and Cummins came together after Mehedi had Matthew Wade plumb leg-before for five, and Shakib drew Glenn Maxwell forward for a stumping on 23 to leave Australia struggling on 144/8.

When he was on 11, Cummins survived a dropped catch by Shafiul Islam at cover off Shakib, and was then reprieved by the third umpire after being given out caught behind.

Mehedi Hasan Miraz celebrates the dismissal of Australian captain Steve Smith. Photo: A.M. Ahad, AP

Shakib finally bowled Cummins for 25 in the evening session and then had Josh Hazlewood caught by Imrul Kayes at short leg to end Australia’s innings and complete his 16th five-wicket haul in Tests – at least one against each of the nine Test teams he faced.

But the left-handed Agar frustrated the Bangladesh bowlers during a 97-ball stay at the crease that included two fours and a six.

“We’re positive. We’ve had a pretty good fightback today, and anything can happen on this wicket,” Agar told reporters.

“Things happen so quickly when the ball’s spinning and turning, and as you saw tonight, a few of them really jumped. So, we’re confident that if we get on a bit of a roll tomorrow, we can knock them over.”

The 23-year-old took the attack to the opposition, but ran out of partners.