Scotland must now hope Georgia beat Argentina on Sunday and prevent the Pumas from picking up a bonus point in the process. Anything other than that scenario would see Andy Robinson's men miss out on a last-eight place for the first time in seven World Cups.
Looking for victory by more than seven points to realistically keep their hopes alive, Scotland dominated for much of the match and led 12-3 with 15 minutes of the second half played.
Despite losing fly-half Ruaridh Jackson early on, the Scots took a 9-3 advantage into the half-time break thanks to a penalty apiece from Chris Paterson and Dan Parks and a 40th-minute drop goal from the replacement playmaker.
Paterson stretched the lead with a another penalty but England kept their composure to immediately cut the gap below the magic eight points courtesy of a Jonny Wilkinson drop goal. The 2003 World Cup winning hero endured another below-par performance with the boot overall, however, as he missed a host of attempts at goal before being replaced by Toby Flood late on.
Scotland looked to be combining victory with a likely early exit as they led 12-6 with time running out but Ashton robbed them of what would have been a famous win regardless of the qualification ramifications when he crossed on 77 minutes.
The Northampton wing had seen little ball throughout the game but he made the most of his first real glimpse of space when he raced home in the right-hand corner following an impressive long pass from Flood.
Wilkinson's replacement then added the touchline conversion to hand England a lead they never relinquished as Scotland chased the two tries they now needed to win the game and prevent England from picking up a vital losing bonus point.
England team manager Martin Johnson admitted that the performance wasn't pretty but that he was impressed with his side's character in difficult circumstances.
"We kept our nerve in the end and got it won. It's never dull," said Johnson.
"We got on top in the second half. We didn't always get rewards but we kept hammering away.
"We let them get the initiative, the momentum. They were in the game and we weren't. In the first half we didn't really have any ball in their half. When we did we got penalties 30, 40 yards out - they were tricky kicks.
"Six points down in a game like this is tough but actually the guys handled it really well, we just had to get the initiative."
The result sees England take on France at Auckland Park a week today, while Scotland expect to fly home tomorrow.
France qualified for the quarter-finals despite an historic defeat to Tonga in Wellington. The Islanders won 19-14 at the Cake Tin but their defeat to Canada earlier on in the group stages ensured they didn't steal second spot in Pool A.