Mehidy Hasan Miraz's 87 not out helped Bangladesh produce a stunning comeback on the third day of the first Test against South Africa at the Shere Bangla National Stadium.
Bangladesh's revival was halted an hour before the scheduled end of the day due to bad light, but they now lead by 81 runs after conceding a 202-run lead in the first innings.
The Proteas looked set to earn an innings victory at a canter when Mahmudul Hasan Joy (40) and Mushfiqur Rahim (33) were removed by Kagiso Rabada in quick succession.
Litton Das (7) was caught behind off Keshav Maharaj (3-105) shortly afterwards as Bangladesh slipped to 112-6 heading into the 35th over.
But Mehidy and Jaker Ali (58) helped the hosts to within one of South Africa's lead at lunch before the second session was stopped for 78 minutes due to heavy rain in Mirpur.
Jaker struck his maiden Test half-century before the delay in play before falling to Maharaj, but Mehidy and Nayeem Hasan (16 not out) remained calm at the crease as Bangladesh ended the day 283-7.
Data Debrief: Mehidy masterclass
Bangladesh have lost five of their last seven men's Tests (W2), including losing each of the last two on the bounce, but Mehidy's knock has them in contention in Mirpur.
Mehidy's 87 saw him register his ninth Test half-century and his fourth this year, smashing nine fours and one six during his 194-minute spell at the crease on Wednesday.