Azam, currently one of the best batsmen in limited overs cricket, smashed a solid 105-ball 115 to lift Pakistan to 305-7 after the home team won the toss and batted.
Shinwari then knocked off the top-order in figures of 5-51 as the visitors -- depleted by the withdrawal of 10 top players who refused to tour over security fears -- were bowled out for 238 in 46.5 overs.
The win gives Pakistan a 1-0 lead in the three-match series with the first ODI rained off in Karachi on Friday. The third and final match is also set for the same venue on Wednesday.
Sri Lanka were down and out at 28-5 before youngsters Shehan Jayasuriya and Dasun Shanaka staged a fightback during their record 177-run stand -- an ODI record for this wicket for Sri Lanka.
Jayasuriya missed his maiden hundred by four runs while Shanaka notched his highest ODI score of 68, but both fell in the space of three balls to surrender the fight.
Jayasuriya hit seven boundaries and a six in his 107-ball knock while Shanaka had six fours and two sixes in his 80 balls.
The match marked the first ODI cricket to be played in Karachi since the same two teams played here in January 2009, on the tour when the visitors’ bus was attacked by terrorists in Lahore. AFP