England into World Cup semi-finals, champions Australia out
Superb death bowling from Mark Wood (3-26) and Sam Curran restricted Sri Lanka to 141 for eight and although they made heavy work of it, England reached their target with two balls to spare.
The 2010 champions claimed a spot in the last four along with Group 1 winners New Zealand. The two semi-finalists from Group 2 will be decided on Sunday.
"I'm not a great watcher and I didn't enjoy that at all," England captain Jos Buttler said of the tense finish.
"We know we had to find a way to win it and thankfully we did. We get through to a semi-final which is really exciting."
Australia had needed a Sri Lanka upset to keep alive their chance of progressing but those hopes looked to have been dashed when Pathum Nissanka was dismissed for 67 in the 16th over of the Asia Cup champions' innings.
Nissanka clubbed Ben Stokes for the first of his five sixes from the second ball of the innings and by the end of the 15th over Sri Lanka were 116 for three and looking good for a decent score at a ground where chasing can be hard.
Spinner Adil Rashid had Nissanka caught at the long on boundary by substitute fielder Chris Jordan to take his first wicket of the tournament and Sri Lanka fell apart, scoring 25 for five over the last five overs.
Openers Alex Hales and Jos Buttler put on 75 for the first wicket before the England captain was dismissed for 28 by Chamika Karunaratne's fine diving catch at deep midwicket off the bowling of Wanindu Hasaranga.
Hasaranga removed Hales caught and bowled for 47 soon afterwards before Harry Brook, Liam Livingstone and Moeen Ali followed cheaply to leave England wobbling on 111-5 in the 15th over.
The victory target was never much more than a run a ball away, however, and Stokes (42 not out) and Chris Woakes (five not out) got them across the line in the final over on 144 for six.
"It was an amazing fight but we could have done better in the batting part," said Sri Lanka captain Dasun Shanaka.
"We played good cricket in patches (over the tournament) but we had a lot of injuries."