The defending champions, skippered by stand-in Matthew Wade in the absence of the injured Aaron Finch, set a total of 168-8 thanks to a fine 54 not out from their middle-order batsman.
With handy support from Mitchell Marsh (45) and Marcus Stoinis (25), the hosts seldom looked as if they would be seriously troubled by their Group 1 rivals.
But Naveen-ul-Haq’s tidy figures of 3-21 gave Afghanistan an achievable target to chase, and a strong third-wicket partnership between Gulbadin Naib (39) and Ibrahim Zadran (26) kept them firmly in the hunt.
After Maxwell effected a run-out of the former, a top-order collapse appeared to spell the end for Mohammad Nabi’s side, but a thrilling final burst from Rashid Khan (48) guided them close to an upset with a 164-7 finish.
Success vaults Australia into the top two for now, but their progress to the last four will only be confirmed if England fail to overcome Sri Lanka in Sydney on Saturday, due to an inferior net run rate.
Magic Maxwell spares blushes
Make no mistake, this was far from a poor Australia performance, but with a negative net run rate at the end, it was not quite up to the mark they would have hoped to achieve.
No accusations can be levelled at Maxwell, however, whose knock off 32 balls was arguably trumped in importance by his direct hit to dismiss Naib, stopping Afghanistan’s momentum and turning the tide.
Khan showcases stirring stuff
Few players are quite as exciting to watch as the Afghanistan man when he is in full flight, and so it proved again after he set up a surprisingly tense finale.
His innings, taken off 23 balls with four maximums, was up there with the best at this tournament.