It could not be set up any more tantalizingly. On Sunday in Mohali, hosts and pre-tournament favorites India will go head-to-head with 50-over world champions Australia for a place in the semifinals of the World Twenty20. It is quarterfinal knockout match in all but name.

Both sides will have hoped than it wouldn’t have come to this. But New Zealand’s stunning form, beating both India and Australia so far, along with Pakistan, to secure qualification with one game to spare, means just one place remains up for grabs.

For both teams, though, there will be considerable relief that they still have a shot of progressing from Group 2.

Australia required a victory over Pakistan on Friday to prevent them from going into the match with India needing to decipher a complex series of mathematical equations involving net run-rate in order to go through.

There were a few nervy moments along the way, particularly when they were 57-3 having elected to bat first in a match that was also played in Mohali. Australia had started slowly in the tournament, losing to New Zealand and recording a nervy win over Bangladesh, with questions raised about their batting lineup after struggles for the middle-order. The changes came against Pakistan, with Aaron Finch returned to the opener spot and David Warner moved up no No. 3.

But, while the top three didn’t get going, those below them did. Along with a quick and useful 30 from Glenn Maxwell, a partnership of 74 from 39 balls between captain Steve Smith and all-rounder Shane Watson, who announced this week that he would be retiring from international cricket after the tournament, proved decisive. Best ever bowling figures for an Australian in T20 internationals from James Faulkner, with 5 for 27, and two pivotal wickets from spinner Adam Zampa, guided Australia to a 21-run victory that in the end was comfortable.

There was nothing comfortable about the way India kept their hopes alive. Indeed, it appeared for a time during their match in Bangalore on Wednesday that Bangladesh were on course for a fairly straightforward victory. After India failed to get going with the bat to be dismissed for 146, Bangladesh looked certainties to claim a historic first victory in India when needing just two runs from the final three balls.

What happened next will not soon be forgotten by anyone who watched on in amazement. Bangladesh conspired to lose back-to-back wickets with unnecessary aerial shots for glory before, on the final ball, captain Mahendra Singh Dhoni whipped off the stumps to deny Bangladesh even the one run they needed to bring about a Super Over.

A defeat would have almost certainly condemned India to a painful early exit from the World T20 in front of an expectant home support, and likely raised fresh questions over the future of 34-year-old Dhoni. Instead Dhoni was being lauded for his cool head and decision-making during the final over from young all-rounder Hardik Pandya.

Still, though, there is work to do. India will doubtless take plenty of encouragement from the 3-0 whitewash they recorded over Australia in a T20 series Down Under in January. But many in the squad will also need no reminding that it was Australia that ended their hopes in last year’s 50-over World Cup. That clash came at the semifinal stage. This time, India and Australia will be putting everything on the line to make the final four.

Prediction: Only against Pakistan have India shown the form they came into the tournament with, which rightly made them the favorites for the trophy. And it is no coincidence that the win over Pakistan was the only time so far in the tournament that Virat Kohli has truly fired. Kohli remains hugely important to India, arguably too important, given how often his teammates fail to step up when he does not post a big innings. Kohli, though, is a man for the big occasion and should be backed to deliver against Australia. It promises to be a finely balanced contest, however, with Australia growing into the tournament after a slow start. The difference could just be India’s greater variety and depth of bowling. The hosts should prevail, but only just.

Match time: Sunday, 10 a.m. EDT