Sri Lanka made 253-8 after being sent in to bat and then bowled out Australia for 233 to join hosts England in the semi-finals from group A with four points each.
However, England topped the group due to a superior run-rate and will take on Group B runners-up South Africa in the first semi-final at the Oval on Wednesday.
Sri Lanka will meet Group B winners India in the second semi-final in Cardiff on Thursday, a repeat of the 2011 World Cup final in Mumbai which India won. The final is at Edgbaston, Birmingham, on Sunday.
Mahela Jayawardene’s classy unbeaten 84 lifted Sri Lanka to a competitive total of 253 for eight. Aussies started brightly and left-armer Mitchell Johnson trapped Kusal Perera lbw with the third ball of the match.
Kumar Sangakkara spooned a catch to cover off Clint McKay to leave Sri Lanka in trouble at 20 for two. But Jayawardene steadied the ship with Dilshan. Australia needed to win in 29.1 overs to qualify