ICC Men's Cricket World Cup, Mumbai
Afghanistan 291-5 (50 overs): Zadran 129* (143), Rashid 35* (18); Hazlewood 2-39
Australia 293-7 (46.5 overs): Maxwell 201* (128); Rashid 2-44
Australia won by three wickets
Glenn Maxwell battled through injury to hit a sensational double century against Afghanistan and guide Australia into the World Cup semi-finals.
Maxwell arrived at the crease to face a hat-trick ball after Australia slumped to 91-7 in pursuit of 292 in Mumbai.
He was dropped twice and struggled with a back injury and cramp but played a remarkable innings, often on one leg post century, to finish 201 not out.
He shared 202 with Pat Cummins (12*) as Australia won with 19 balls to spare.
Afghanistan, who had earlier made 291-5 with Ibrahim Zadran hitting their first World Cup century, were well set to join Australia in the current top four after a rampant start in the field before Maxwell produced one of the all-time great innings.
He had already hit the fastest World Cup century earlier in the tournament against the Netherlands and returned to the Australia side for this game after missing Saturday's win over England because of a concussion sustained after falling off the back of a golf buggy.
It was a truly breathtaking innings, with remarkable reverse sweeps for six, flicks and whips over the leg side on one leg, which will also be remembered as an incredible show of grit and determination.
He is the first Australian to hit a double century in a one-day international and was mobbed by his ecstatic team-mates, who could barely believe what they had seen.
It is the 11th double ton in ODI history but the first ever struck while chasing.
Australia's sixth win in a row sees them set up a semi-final clash against South Africa.
One of New Zealand, Pakistan and Afghanistan will claim the final knockout spot - all three sides are currently on eight points - to face leaders India.
Maxwell produces all-time great innings
At the interval a tight game felt likely, though Afghanistan were favourites, with no side completing a chase of more than 281 at the Wankhede Stadium and Australia also needing to pull off their highest chase in World Cups.
After Afghanistan's rampant start, where Australia were guilty of loose strokeplay and lacking a calm head, it looked certain Jonathan Trott's side would pull off their first win over Australia.
Yet Afghanistan let the game slip when Maxwell was dropped in the covers on 24, before Mujeeb Ur Rahman put down an easy chance at short fine leg with Maxwell on 33.
He was also halfway off the pitch after reviewing when given out lbw on 27, only to return in shock when the technology showed it was going over the stumps.
The 35-year-old is one the most destructive batters in the game and this was another example of his game-changing talent.
He struck 10 fours and three sixes in his first century, which came up off 76 balls, before the back struggles and cramp left him hobbling.
He received treatment on numerous occasions, while Adam Zampa, the next man in, came down prepared to bat twice.
But Maxwell persevered, his second century taking 54 balls, with most boundaries followed by a grimace or stretch of the leg or back.
The all-rounder showed a nerveless ability to clear the ropes and find the gaps, but also calmly turned down singles and twos he knew he could not make, while never letting the require run rate spiral.
He finished the game with a monstrous flick over the leg side to bring up his double century off 128 balls, including 21 fours and 10 sixes.
Zadran's century not enough
On reflection it may look like Afghanistan failed to put enough on the board, but they were simply denied by one of the greatest innings.
South Africa and hosts India have undoubtedly been the standout batting sides in this tournament, but Afghanistan are next on the list.
They have shown great maturity, both in setting a winning total against England and in their victories while chasing against Pakistan, Sri Lanka and the Netherlands.
There is a calmness bestowed upon them from head coach Trott, who was regarded as one the toughest players during his international career with England.
On this occasion they were was led by opener Zadran, who played some beautiful shots through the covers at the start of his innings before demonstrating his power over the leg-side, hitting an unbeaten 129 from 143 balls.
Australia were far from their best in the field but seemed happy to just restrict Afghanistan's scoring, only to then take significant punishment late on.
Afghanistan added 96 off the final 10 overs, including 64 off the last five, with Rashid Khan hitting a superb unbeaten 35 off 18 balls to lift his side to their highest World Cup score.
Maxwell's heroics meant it did not matter here but death bowling is one area Australia will have to tighten up on for the semi-finals.
'I don't know know how you describe that' - reaction
Player of the Match, Australia's Glenn Maxwell: "Horrific, I feel shocking. It was quite hot when we were fielding, I haven't done a whole lot of high intensity exercise in the heat. It got a hold of me, I was lucky to stick it out until the end.
"It would've been nice if it was chanceless, I've lived a very charmed life out there. To make the most of it, be not out with Patty out there at the end I'm proud of."
Australia captain Pat Cummins: "Just ridiculous. I don't know how you describe that.
"A great win but Maxi was just out of this world. It's got to be the greatest ODI innings that has ever happened.
"It's important. Not only from our team, thinking you can win from anywhere, but opposition look at that as well. It gives us real belief and we're into the semi-finals now so that's great."
Afghanistan captain Hasmatullah Shahidi: "Really disappointed. Cricket is a funny game, it was unbelievable.
"Our bowlers started really well, we dropped chances for the eighth wicket. Maxwell doesn't stop, I have to give credit to him.
"I am proud of the team, the team will be disappointed because we didn't think that could happen. We will try our best to come out stronger against South Africa."