Former champions India beat South Africa by one run on Wednesday morning in Sri Lanka but still crashed out of cricket's Twenty20 World Cup as Pakistan went through to the semi-finals with a higher run rate.
India made 152 for six in their 20 overs and needed to restrict South Africa to 121 runs or less to reach the last four at Pakistan's expense.
In the event they dismissed the Proteas for 151 for a narrow but academic victory.
Pakistan will meet hosts Sri Lanka in the first semi-final in Colombo Thursday night while Australia, who also went through on run rate despite losing to Pakistan
Chasing 150 for victory, Australia could manage only 117 for seven from their 20 overs, but once they'd reached 112 they knew they were into the semi-finals on their run-rate, joining Sri Lanka and the West Indies in the last four.
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.
Australia will play the West Indies on Friday night.