Perth Glory beat out Sydney FC for the last place in the A-League finals with a 1-1 draw against Adelaide United at nib Stadium on Saturday night.
The Glory entered the match needing only a draw to leapfrog Sydney into sixth spot on goal difference.
Adrian Zahra's 58th-minute goal eased the tension, but the Glory were given a fright when Adelaide midfielder Jake Barker-Daish pegged one back in the 91st minute.
And the Reds almost snatched victory with the final play of the match, only for Perth goalkeeper Danny Vukovic to pull off a sharp diving save to deny Dario Vidosic's long-range free kick.
The result capped a remarkable turnaround for Perth, who were dead last on the ladder when Alistair Edwards took over as coach last month.
Under Edwards, Perth won four and drew one of their seven games to secure a fairytale finals berth.
But the work of previous coach Ian Ferguson shouldn't be forgotten.
A string of heartbreaking one-goal losses brought about Ferguson's undoing.
But the close nature of those results meant Perth's goal difference never suffered terribly.
And in the end, it was their superior goal difference compared to Sydney that decided the race for sixth spot.
Sydney's finals chances were hanging by a thread following a 3-1 loss to Brisbane on Thursday night.
The Sky Blues needed both Newcastle and Perth to lose their matches.
Western Sydney's 3-0 win over the Jets completed the first part of the equation, but Perth became the ultimate party poopers in front of their biggest ever home crowd of 16,707 in the A-League.
Perth dominated play against Adelaide in the opening half but couldn't find the back of the net despite creating a series of good chances.
Ryo Nagai should have put the home side ahead when he was taken down by Cameron Watson in the box.
But his scuffed penalty was deflected onto the post by a diving Eugene Galekovic, with Glory players unable to capitalise on the rebound.
Adelaide's defence finally cracked in the 58th minute when Steve McGarry's dangerous cross was met by Zahra.
Although Adelaide goalkeeper Galekovic got a palm to Zahra's strike, the ball bounced in off the crossbar, with Zahra celebrating his third career goal with an acrobatic backflip routine.
Glory midfielder Steve McGarry should have made the result safe in the 84th minute, but sprayed his close-range shot wide of the target.