Skipper Misbah-ul-Haq made 16 not out, sharing a match-winning stand of 30 with Afridi.
It was Pakistan's 26th win in 27 one-dayers against Bangladesh, the lone defeat having come during the 1999 World Cup in England.
Bangladesh, who lost half their batsmen for 31 runs on the slow wicket, were dismissed in 30.3 overs and barely passed their lowest one-day total against Pakistan of 87.
Wicket-keeper Sarfraz Ahmed picked up four catches as the four Pakistani spinners shared eight of the 10 wickets.
Bangladesh's batting never recovered after losing opener Tamim Iqbal with the fourth ball of the innings, trapped leg-before by off-spinner Mohammad Hafeez.
Seamer Umar Gul, who shared the new ball with the spinner, struck in his third over when he forced Naeem Islam to edge a catch to the slips.
Bangladesh skipper Mushfiqur Rahim was caught behind off Shoaib Malik for 11, before Afridi grabbed two wickets in one over to reduce the Tigers to 5-31.
Afridi had opener Shahriar Nafees caught at backward point by Malik and then saw Mohammad Mahmudullah edge a catch to Sarfraz three balls later.
Nasir Hossain and Shakib put on 36 for the sixth wicket and Nasir made 21 before he top-edged a catch off Aizaz Cheema, while Shakib became Afridi's third victim on 15.
Last man Rubel Hossain hit an unbeaten 15 before Afridi claimed the final two wickets.
The second one-dayer will be played at the same venue tomorrow.
Afridi made his peace with former coach Waqar Younis, who took the captaincy from him after a fiery tour of the West Indies.
The pair met recently in the United Arab Emirates and resolved their differences.
"Look, when you work together like I and Shahid did you have such difference of opinions and disagreements and that is exactly what happened with us,"Waqar said.
"But in the end what is important is that both of us just wanted to see Pakistan cricket do well."
AAP