The 21-year-old struck twice in his second over, dismissing opening batter David Warner for seven and number three Marnus Labuschagne before he had scored, reducing Australia to 8-2.
Usman Khawaja and Steve Smith steadied Australia’s innings with an unbroken third-wicket stand of 62, taking them to 70 for two at lunch on the opening day after the touring side won the toss and opted to bat.
Opener Khawaja was unbeaten on 31 with Smith, Australia’s batting mainstay, 28 not out at the crease.
The first two tests of the series – the first between the sides in Pakistan since 1998 – were drawn.
With Lahore’s Gaddafi Stadium hosting a test match for the first time since the 2009 attack by gunmen on a bus carrying the Sri Lankan cricket team, left-armer Afridi gave local fans reason to cheer with the two early wickets.
Australia could have been in even deeper trouble but Pakistan failed to capitalise on chances offered by both Khawaja and Smith.
Looking to dominate left-arm spinner Nauman Ali from the onset, Khawaja, on 12, flashed hard at a full-pitched delivery but the resulting edge flew under the hands of Babar Azam at the lone slip position.
On the next delivery, Nauman failed to hold on to a straightforward return catch from Smith, with the batter on 19.