However when Shane Watson was dropped on four at fine leg, a sitter by Rahat Ali off Riaz, it proved a turning point.
Watson, given a grilling by Riaz, finished unbeaten on 64, Steven Smith made a classy 65 and Glenn Maxwell rushed Australia to the win with 44 not out off 29 balls.
Watson and Maxwell, who was also dropped on five, put on an unbroken 68 in just 37 minutes.
''I thought our bowlers did a fantastic job again, the fielding was excellent, but credit to Pakistan and Wahab for the way he bowled," Australian captain Michael Clarke said.
''They really put us under pressure and it was as fast a spell as I've seen in a long time."
Riaz's opening burst of six overs, two for 24 was compelling viewing and came within a dropped catch of possibly pulling off what would have been a stunning upset.
Pakistan's captain, Misbah-ul-Haq, conceded poor shot selection hurt their cause, but acknowledged Australia deserved the win.
''They bowled and batted really well. It's obviously disappointing. But Wahab really bowled his heart out. I've never seen bowling like that."
So while Pakistan head home - and after a rough start with losses to India and the West Indies, they probably figure making the quarter-finals a reasonable result - Australia eye an Indian team playing far better than they did when being beaten repeatedly in their bilateral series earlier in the summer.
''India are in good form, playing really well and it's certainly going to be a tough challenge. Our top four have to bat better than we did tonight," Clarke said.
He also cautioned against putting too much pressure on themselves as it is the high stakes World Cup.
''It's no different to any other games. I've spoken a lot to the team about not setting the bar too high, not putting the World Cup on a pedestal.
''Sometimes if you build something up so much, it's really hard to win."
In the first semifinal, at Eden Park on Tuesday, South Africa will play the winner of today's fourth quarter-final between New Zealand and the West Indies.