The Sydney Thunder have staggered to a three-wicket win against the lowly Melbourne Stars, booking their spot in the BBL finals.
Chasing just 120 to win at the MCG, the Thunder slumped to 5-60 and were in danger of blowing a golden opportunity to seal a place in the top-five.
The Thunder were staring down the barrel after being 7-88 but Stars captain Adam Zampa dropped a sitter to give Daniel Sams a life.
Sams smashed an important, quick-fire 28 before Zampa (3-26) bowled him in the next over to keep the Stars in the match.
But the damage from Zampa's dropped catch had been done with captain Chris Green and Nathan McAndrew steering the Thunder home with seven balls remaining, securing fourth spot and a home final.
The win knocked Hobart out of fifth spot after the Hurricanes had earlier on Wednesday beaten Brisbane in a thrilling encounter at Blundstone Arena.
The Thunder will host the Heat at Sydney Showgrounds on Friday night in a knockout final.
During the Stars' innings of 7-119, Pakistan spinner Usman Qadir dominated with figures of 3-24.
Qadir claimed the key scalps of Tom Rogers (35), Australia white-ball player Marcus Stoinis and big-hitting Beau Webster to put the Thunder in a commanding position.
Former Australia player Hilton Cartwright top-scored for the Stars with a patient 36, but fell to Thunder captain Chris Green (2-19).
Veteran bowling allrounder Nathan Coulter-Nile's miserable form with the bat continued, falling for his fourth duck in a row.
The Stars completed a horror campaign on the bottom of the ladder after winning just three of 14 matches.