Saeed Ajmal and Raza Hasan spun Pakistan to a 32-run victory against Australia in their Super Eight match to keep alive their World Twenty20 semi-final hopes on Tuesday.
Despite the defeat, Australia advanced to join Sri Lanka and West Indies in the last four with a superior net run-rate after beating India and South Africa in their earlier Super Eight matches.
Off-spinner Ajmal took three wickets for 17 while man-of-the-match Hasan picked up two for 14 runs as Australia could only manage 117 for seven in their 20 overs, chasing 150 for victory.
Hafeez thanked his bowlers for rising to the occasion after the eight-wicket defeat against arch-rivals India on Sunday.
"Everybody realised that we have to win the game and win with a margin. I am grateful to see the effort of the boys," Hafeez said during the post-match presentation ceremony.
"It was terrific by everybody and every bowler did a great job for Pakistan. We wanted our bowlers to do the job and we got the total we really wanted.
"Raza Hasan was brilliant tonight. He is a surprise for everyone at the moment."
The Australian middle-order struggled once their in-form openers Shane Watson and David Warner were dismissed early.
Left-hander Mike Hussey's unbeaten 54 proved crucial as it took Australia past the 112-run mark required by them to advance to the semi-finals.
Hafeez also picked up two wickets as he used five spinners to complete 18 out of the 20 overs in the Australian innings.
Australia captain George Bailey said his team failed the spin test.
"Pakistan completely outplayed us tonight. Pakistan took early wickets to put pressure on us and they have some quality spinners," Bailey said after the match.
"To this point we have been really consistent so the challenge now will be to get back to that form for the semi-finals."
Put into bat, Nasir Jamshed compiled a fine 55 to take Pakistan to 149 for six wickets, despite a fiery spell of fast bowling from left-arm seamer Mitchell Starc, who took three for 20 runs.
Kamran Akmal made 32 and added 79 runs for the third wicket with Jamshed to give Pakistan some momentum after a slow start.
Photograph: Philip Brown/Reuters