DHAKA, Bangladesh — Mehidy Hasan took five wickets to propel Bangladesh toward a series-leveling 218-run win against Zimbabwe in the second cricket test on Thursday.

The Bangladesh offspinner returned 5-38 to help dismiss Zimbabwe for 224 in the middle of the last day despite a defiant, unbeaten 106 from Brendan Taylor.

Hasan underlined his importance as an allrounder in the absence of Shakib Al Hasan with figures of 8-99 for the match, combined with two unbeaten innings of 64 and 27.

“Our ego was hurt after losing the first test,” Bangladesh captain Mahmdullah said. “We wanted to win this test badly.

There were things to be fixed. We were a more disciplined side in this test than the first test.

“But we were not totally happy because we can’t win the series. When we play at our home ground, our target is always to win the series. In this sense, it is not a good feeling to share the trophy.”

Taylor, who scored 110 in Zimbabwe’s first innings, resisted the Bangladesh spinners but didn’t get enough support for his lineup to bat through the last day to salvage a draw.

It was Taylor’s second pair of centuries in a test following his 171 and 102 not out in 2013, also against Bangladesh, making him the third Zimbabwe batsman to achieve that after brothers Andy and Grant Flower.

Opener Brian Chari was the other notable contributor for Zimbabwe with 43.

“The biggest thing for us is, the way the guys played in both tests just showed us what we can do as a team,” Zimbabwe captain Hamilton Masakadza said.

“It will give us a lot of confidence going forward. Having been in battles like this really hardens you, and you come out the better for it. We showed what we can do in foreign conditions, conditions that have been really hard for pretty much everyone around the world.

“A world-class performance from a world-class player there in Brendan Taylor. He really showed the way of how to bat in these conditions. That was really impressive.”

Resuming the day on 76-2 and needing to survive three sessions for a draw to seal their first test series victory since 2011, Zimbabwe began cautiously with Taylor leading.

Pace bowler Mustafizur Rahman got the opening breakthrough in the third over, dismissing Sean Williams for 13.

Left-arm spinner Taijul Islam continued tormenting Zimbabwe with his guile and turn to collect the wicket of Sikandar Raza for 12. He finished the series with 18 wickets, including three five-wicket hauls.

Taylor and Peter Moor combined in a patient 66-run partnership to raise hope of a draw, until Hasan fired a quicker delivery and got an inside-edge off Moor, who scored 13 from 79 deliveries.

But the big blow came when Regis Chakabva was run out for 2, exposing the lower order.

Hasan then took less than a half-hour to finish off the innings and the match.

Bangladesh set up the match with its first innings of 522-7 declared, which included Mushfiqur Rahim’s career best 219 not out and Mominul Haque’s 161.

The hosts took a 218-run first-innings lead after dismissing Zimbabwe for 304, then declared again at 224-6 — after skipper Mahmudullah’s first century in eight years — leaving Zimbabwe in a record chase of 443 to win the series.