Pakistan reached 109-0 in their second innings at stumps on the fourth day chasing a target of 202 in their first Test against Bangladesh in Chittagong on Monday.
Both openers Abid Ali (56) and Abdullah Shafique (53) completed their fifty as the visitors came within 93 runs of victory after bowling out the hosts for 157 earlier in the day.
Resuming on 39-4, Bangladesh looked down and out once they lost Mushfiqur Rahim in the first over of the day, before Liton — who struck a hundred in the first innings — hauled the hosts back to respectability with 59 off 89 balls.
Afridi trapped Liton leg-before and then had Abu Jayed out for a duck to complete his fourth five-wicket Test haul, before off-spinner Sajid Khan, who finished with 3-33, wrapped things up by dispatching Taijul Islam.
The hosts had got off to a positive start with Mushfiqur hitting a boundary off the first ball of the morning, bowled by Hasan Ali.
But two balls later he left the wrong delivery and departed for 16 after Hasan struck off-stump.
Das joined overnight batsman Yasir Ali to prevent further collapse.
Liton survived on 26 when he was given out, caught at short leg off Sajid Khan. The replay showed that the ball only hit his pad and was going down the leg.
Sajid was rewarded for his persistence as he trapped Mehidy Hasan leg before for 11.
Substitute Nurul Hasan replaced Yasir after Mehidy's dismissal and barely survived a strong caught-behind appeal just before lunch.
Nurul heaved one at long-on to Faheem Ashraf off Sajid after the break, getting dismissed for 15, and Pakistan took little time to take the remaining wickets.
Bangladesh have failed to defeat Pakistan in any of their 10 previous encounters.