Australia sustained a 32-run defeat in their final Super Eights match against Pakistan, but were still able to celebrate a place in the World Twenty20 semi-finals alongside their conquerors.
After easily winning their opening two Super Eights matches Australia could afford to lose after Pakistan posted 149 for six batting first. That left George Bailey's side needing 112 to go through, however, they edgily reached that mark in the 20th over - thanks almost solely to Mike Hussey's unbeaten 54 - to finish on 117 for seven.
Despite Pakistan's win their progress to the last four was not assured until India failed to beat South Africa by enough to overtake them in the later game. India could only beat the Proteas by a single run after needing to win by 31 runs.
Pakistan will therefore meet hosts Sri Lanka in the last four while group winners Australia will face West Indies - who they best in the group stage - as they aim to to reach Sunday's final in Colombo.
Australia skipper George Bailey won the toss and opted to field first, Mitchell Starc making good on that call when he removed the dangerous Mohammad Hafeez for four with the first ball of the second over.
The left-armer should have added the scalp of Nasir Jamshed for a duck two deliveries later, but he was dropped by Glenn Maxwell at slip. Jamshed was soon off the mark and a couple of quick boundaries by Imran Nazir got Pakistan's innings going.
The on-song Shane Watson accounted for Nazir (14) just before the end of the powerplay, but Jamshed continued compiling runs steadily alongside Kamran Akmal.
Jamshed struck Pat Cummins for the first six of the day in the 11th over and followed with a second off Xavier Doherty moments later. Four more off Brad Hogg brought up Jamshed's 50 and Akmal clubbed a six of his own off the veteran spinner.
Doherty eventually prised out Jamshed for 55 and Starc returned to remove Akmal and Shahid Afridi as he returned three for 20. Only Abdul Razzaq, with 22 off 17 balls, made a significant contribution in the closing overs.
Australia's dangerous opening pair failed a trial by spin, both Watson and David Warner lbw for eight to Raza Hasan and Hafeez respectively, but Mike Hussey provided the backbone of the innings, making 54 not out in 47 balls, including the boundary that ensured his side would continue in the competition.