Australia, the reigning champions and unbeaten before this Centurion clash after a win and a washout, were cruising to their victory target of 206 before late wickets meant a scrambled single off the final ball secured the win.
Ricky Ponting's side will play England in the first semifinals at Centurion on Friday.
Pakistan play New Zealand in Johannesburg on Saturday in the second semi-final.
Image: Ricky Ponting (2nd L) of Australia tosses the coin with commentator Ian Chappell (L), Younis Khan (2nd R) of Pakistan and match referee Javagal Srinath looking on ahead of the ICC Champions Trophy Group A match between Australia and Pakistan played at Supersport Park on September 30, 2009 in Centurion, South Africa.
Images: Getty (Unauthorised reproduction is prohibited)