ABU DHABI (AFP)

Sediqullah Atal's marathon century and some inspired lower-order resistance lifted Afghanistan to a dramatic draw in the one-off Test against Bangladesh on Tuesday.

Opener Atal, playing only his third Test, batted for eight-and-a-half hours for his 332-ball 111 before number nine Qais Ahmad hit an unbeaten 49 in Abu Dhabi.

Having started the final day on 132-3, Afghanistan survived to finish on 346-8, from a total of 142 overs, after being set a mammoth 479-run target to win.

When Atal fell to a close-in catch off left-arm spinner Taijul Islam soon after tea with the score at 281-7, Bangladesh had victory in sight. But Qais and fellow tail-ender Yamin Ahmadzai (19 off 85 balls) batted for 110 deliveries in a valiant 45-run stand for the eighth wicket to resist Bangladesh's spinners.

Even when Ahmadzai fell to Mehidy Hasan Miraz, Bangladesh had five overs to enforce a win but Qais and number 10 Zia-ur-Rehman hung on, although not without drama.

There were two missed run-out chances in the final session and a dropped catch, while Qais gave his teammates watching from the boundary some heart-stopping moments.

The leg-spinner mixed solid defence with a penchant for dancing down the pitch, even hitting the second ball of the last over for six. The Bangladesh players were less than impressed with Qais when he went down with an apparent hamstring injury and received treatment after playing a forward defence with 10 minutes remaining.

With a famous draw already secured, he hammered the final delivery of the match deep over midwicket for another maximum, falling to the turf in celebration.

"This draw is equal to a win, actually," Rahmat said. "Great effort by our boys. If you look at it, we had planned beforehand. Whether it was in the bowling department or the batting department, we went according to that plan. If runs were needed, we scored runs, and if we needed to spend time, we spent time. That is why our result went towards a draw."

Paceman Ebadot Hossain took 3-50 and off-spinner Miraz finished with 3-73, but it was not enough for Bangladesh, whose skipper Najmul Hossain Shanto praised Afghanistan's resilience.

"It is disappointing not win, but Afghanistan played brilliantly," said Shanto. "I expected the spinners to come into the match. They tried but Afghanistan played very good cricket."

Atal earlier reached his century with a boundary off Hasan Mahmud, becoming the first Afghanistan batter to reach three figures in the fourth innings of a Test.

Hashmatullah Shahidi also scored 36 and helped Atal defy the Bangladesh bowling, but holed out to mid-on attempting a big shot down the ground, just seven minutes before tea.

Ismat Alam batted for 60 deliveries for his four – scoring his first run off his 44th delivery – before Miraz had him caught by Shanto. With under two hours left, Bangladesh were finally rewarded with Atal's wicket as the left-hander pushed a turning delivery from Islam and a thick edge was well caught at short-leg by Tanzid Hasan.

But the exploits of Ahmadzai, Qais and Zia ensured the Afghans had the last say.