Seamer Nahid Rana claimed 5-40 on an eventful final day to bowl Bangladesh to a 104-run victory in the opening test against Pakistan in Mirpur on Tuesday.
The hosts set Pakistan a victory target of 268 and then bundled them out for 163, prising out seven wickets in the final session to go 1-0 up in the two-test series.
Bangladesh had posted 413 in their first innings and Pakistan responded with 386 to stay in the hunt.
With significant time lost to rain on third and fourth days of the contest, Bangladesh declared their second innings on 240-9.
Skipper Najmul Hossain Shanto followed his first-innings hundred with 87 and Mominul Haque (56) scored his second half-century of the match.
The onus was on their bowlers to script a memorable win and Rana led their attack with an inspired display of fast bowling to fashion Bangladesh's first victory against Pakistan on home soil.
Abdullah Fazal made a gutsy 66 but Pakistan kept losing wickets at regular intervals and could not bat out the final day.
Rana dismissed Shaheen Afridi, caught at forward short leg, to seal the win. Fellow seamer Taskin Ahmed and spinner Taijul Islam claimed two wickets apiece.
"Very happy. Proud of all the guys the way we played," Bangladesh captain Shanto said after collecting his player of the match award.
"We declared because we have a quality bowling attack and in these conditions Rana, Taskin, Taijul bowled really well and that's what I want from them."
Pakistan captain Shan Masood said they failed to exploit the seam-friendly conditions at the Shere Bangla National Stadium.
"We couldn't make the most of it with both bat and ball. I thought we could have pushed ahead and scored more runs (in the first innings)," he said.
The final test is scheduled in Sylhet from Saturday.

Austria triumph on World Cup return with 3-1 win over Jordan
Messi hat-trick equals goalscoring record as Argentina beat Algeria
Mbappe double fires France to impressive win over Senegal
Haaland scores twice as Norway beat Iraq on World Cup return
Amorim named Milan manager as club look to rebuild
