Shanto made 101 off 130 balls (12 fours and two sixes) to steer Bangladesh to 4-301 at stumps in Dhaka on Friday.
Mominul Haque missed out his ton, dismissed on 91.
Shanto and Mominul combined for a 170-run partnership for the third wicket to steady the innings after Bangladesh had slumped to 2-31 after 10.1 overs.
Pakistan captain Shan Masood won the toss and sent Bangladesh in to bat first, a decision his pacers justified with disciplined bowling.
Opener Mahmudul Hasan Joy survived an early chance on six but could not make it count, edging behind off Shaheen Shah Afridi for eight.
Fellow opener Shadman Islam also struggled against the movement before edging to first slip for 13.
Shanto and Mominul resisted with resolute batting to shift the momentum in the home side's favour. Shanto reached his ninth Test century off 129 balls by driving Abbas through extra-cover for a boundary. It was his fourth  tonin his past nine innings.
However, Abbas struck back on the next delivery to finally end the dominant partnership.
Mominul found support in veteran Mushfiqur Rahim to further drive the home side, keeping the Pakistan bowlers frustrated. But left-arm spinner Noman Ali's persistence paid off when he had Mominul lbw with the batter nine runs away from his 14th century.
Mushfiqur, who was batting on 48, and Litton (4no) took Bangladesh past 300 runs, capping off a successful day for the hosts.