Tamim Iqbal and Imrul Kayes produced a record 273-run partnership in an unbroken opening stand to help Bangladesh whittle down Pakistan's huge lead to 23 runs at the close of the penultimate day of the opening Test at Khulna.
Facing a huge 296-run first innings deficit after Pakistan were all out for 628, the hosts did not retreat into a defensive shell and counter-attacked instead through Tamim (138 not out) and Imrul (132 not out).
Tamim survived a strong leg before appeal off the first ball he received from Junaid Khan and Pakistan decided to review the decision after the appeal was turned down but could not get it overturned.
The left-hander did not look back and went on to hit his seventh Test century - the most by a Bangladeshi batsman - in 123 balls while Imrul helped himself to his third Test hundred.
Earlier Pakistan, resuming on 537 for five, lost their last five wickets for 34 runs and were all out for their highest total against Bangladesh.
Both the overnight batsmen Asad Shafiq (83) and Sarfraz Ahmed (82) fell short of centuries at the Sheikh Abu Nasser Stadium.
Left-arm spinner Taijul Islam's six for 163 was the most successful bowler for the hosts but the day belonged to the Bangladeshi openers who frustrated the Pakistani attack on a surface on which 1200-plus runs have been scored over four days with only 20 wickets taken.
Tamim hit four sixes and 13 boundaries in his entertaining knock, playing with aggression which occasionally bordered on recklessness.
Imrul had to keep wicket for more than 100 overs after skipper Mushfiqur Rahim injured his right hand but he did not let it affect his batting, hitting 15 boundaries and three sixes.
The previous highest stand for Bangladesh was the 267 for the fifth wicket between Mohammad Ashraful and Mushfiqur against Sri Lanka at Galle in 2013.
Bangladesh scored 332 in their first innings in which Mominul Haque top scored with 80.