Canada failed to cope with the Pakistan captain's faster legspinners in an inspirational performance and was shot out for 138 in 42.5 overs.
Canada's fast bowlers had used the overcast conditions to perfection and gave their team real hope of causing an upset by dismissing Pakistan for 184 in 43 overs in the Group A match.
Jimmy Hansara (43) then further improved Canada's chances by sharing a 60-run fourth wicket stand with Zubin Surkari (27).
But Afridi - perhaps wanting to make amends for his surprise decision to bat first - rattled the middle-order with four wickets off 17 balls and also ran out Balaji Rao off a superb direct throw.
Afridi took his wickets tally to 14 in the World Cup after his 5-16 and 4-34 in earlier victories over Kenya and co-host Sri Lanka respectively.
Pakistan-born Rizwan Cheema tried to break the shackles and lofted Afridi over wide midwicket for a boundary before he was clean bowled by the legspinner off the next delivery.
Afridi went on to shatter the stumps of Hansara and Harvir Baidwan off successive deliveries in the next over before Wahab Riaz - playing in place of Shoaib Akhtar - brought up a well judged diving catch to remove Gordon Taylor.
Earlier, Baidwan (3-35) had rocked Pakistan's top order with a superb display of swing bowling and then wrapped up the innings when he bowled No.