The tourists, trailing by 369 runs on the first innings, fought hard to make 106-2 in their second knock when a heavy shower halted play five minutes before lunch on the fourth day.
The 21-year-old Nafees, a surprise omission from Bangladesh's one-day squad for the upcoming series against Sri Lanka, answered the selectors with nine boundaries in his third Test half-century.
Captain Mohammad Ashraful was the other batsman at the crease on two with Bangladesh still needing 263 runs to avoid a third successive innings defeat in the series.
Bangladesh began their second knock at the start of the day after Sri Lankan captain Mahela Jayawardene declared at the overnight score of 500-4, leaving Kumar Sangakkara unbeaten on 222.
Nafees and Javed Omar put on 47 for the first wicket, missing by one run their best opening stand in the series of 48 in the second Test.
Omar made 22 with the help of four boundaries when he edged fast bowler Lasith Malinga to Sangakkara at first slip.
Former captain Habibul Bashar helped Nafees put on 51 for the second wicket but could not break the poor streak that saw him aggregate just 54 runs in the previous five innings of the series.
Bashar, Bangladesh's most experienced Test batsman, made 15 when he stepped out to loft Muttiah Muralitharan out of the ground, missed the line and was bowled.
Bangladesh will resume after lunch needing big scores and a little help from the weather to avoid another big defeat. Rain has been forecast over this hill resort over the next two days.
Brief Scores (at lunch, D-4):
Bangladesh 131 and 106 for 2 (Shahriar Nafees 57 n o, Javed Omar 22; Murali 1 for 13, Malinga 1 for 41) Vs Sri Lanka 500 for 4 decl (Sangakkara 222 n o).