Match ends, Hearts 2, Partick Thistle 4.
Partick Thistle sealed their Premiership safety after producing a stunning second-half comeback to get the better of Hearts.
Callum Paterson opened the scoring for the hosts before Lyle Taylor squared it, but Danny Wilson nodded Hearts back in front before the break.
Gary Fraser levelled with a super strike, Lee Mair headed the Jags in front and Kallum Higginbotham won it.
The victory means Thistle cannot finish in the relegation play-off position.
And that sets up a thrilling showdown between Hibernian and Kilmarnock, who are now the only teams in danger of finishing 11th in the table, at Easter Road on Saturday.
Fresh from their 5-0 demolition job on Kilmarnock on Sunday, Hearts started brightly with the lively Sam Nicholson leading the charge.
The Jags soon found their feet, though, and Higginbotham tested Mark Rigders with a long-range effort, but the stand-in Hearts goalkeeper gathered at the second attempt.
The home side opened the scoring after 16 minutes. Paterson produced a great run in from the right, ghosted past Mair and fired in his 11th goal of the season, despite goalkeeper Paul Gallacher getting a hand to the shot.
It could have been 2-0 seconds later after a delightful move by the hosts.

Kevin McHattie picked out Dale Carrick and his through-ball was perfect for Billy King, but after going one-on-one with Gallacher, he could not keep his shot down.
It was all Hearts for a spell as the Jags struggled to contain the home attack, but the visitors squared it against the run of play just after the half hour.
Higginbotham did the set-up work with a fine pass to send Taylor in on goal and he showed great composure to finish through the legs of Ridgers from 18 yards.
The Jags almost took the lead after 37 minutes, but Taylor's glancing header drifted wide.
Within a minute, the visitors found themselves trailing again.
Hearts won a free-kick on the edge of the area and, from McHattie's delivery, the unmarked Wilson steered a header into the bottom corner.
Taylor thought he had levelled at the start of the second half with a fine volley from Higginbotham's pass, but the offside flag halted Thistle's celebrations.
Only for a few seconds, though, as Gary Fraser did make it 2-2 with a sensational strike that flashed past Ridgers and into the top corner from 25 yards.
James Craigen then passed up a great chance for Thistle after beating the offside trap and Ridgers had to be at his best to keep out a Taylor volley as Thistle piled forward in search of a third.
The goal they craved, and their second-half dominance merited, duly arrived in 68 minutes. A corner was knocked down by Aaron Taylor-Sinclair and Mair headed home.
It was 4-2 a few minutes later when Higginbotham blasted into the net after Ridgers saved Taylor's drive, securing the Jags' place in the Premiership for next season and piling the pressure on Hibs and Killie.
Line-ups
Hearts
Formation 4-5-1
- 13Ridgers
- 12PatersonBooked at 75minsSubstituted forMcKayat 88'minutes
- 3McHattie
- 15Holt
- 5McGowan
- 4Wilson
- 19KingSubstituted forWalkerat 67'minutes
- 8RobinsonBooked at 45minsSubstituted forSmithat 67'minutes
- 18Carrick
- 2Hamill
- 28Nicholson
Substitutes
- 1MacDonald
- 14Walker
- 16McKay
- 17Smith
- 29Oliver
- 30McGhee
- 31Beith
Partick Thistle
Formation 4-4-1-1
- 12Gallacher
- 16McMillan
- 3Taylor-Sinclair
- 22Fraser
- 15Mair
- 6Balatoni
- 14ElliottBooked at 90mins
- 8BanniganSubstituted forErskineat 65'minutes
- 21TaylorSubstituted forDoolanat 79'minutes
- 7Craigen
- 23HigginbothamBooked at 74minsSubstituted forRojo de la Vega Piccoloat 84'minutes
Substitutes
- 1Fox
- 9Doolan
- 11Lawless
- 13Rojo de la Vega Piccolo
- 17Moncur
- 28Erskine
- 31Wilson
- Referee:
- Crawford Allan
- Attendance:
- 14,059
Match Stats
- Possession
- Home51%
- Away49%
- Shots
- Home6
- Away15
- Shots on Target
- Home2
- Away9
- Corners
- Home2
- Away4
- Fouls
- Home8
- Away11
Live Text
Post update
Full Time
Second Half ends, Hearts 2, Partick Thistle 4.
Booking
Christie Elliott (Partick Thistle) is shown the yellow card.
Post update
Foul by Christie Elliott (Partick Thistle).
Post update
Jamie Walker (Hearts) wins a free kick on the left wing.
Post update
Attempt saved. Gary Fraser (Partick Thistle) right footed shot from outside the box is saved in the centre of the goal.
Post update
Attempt missed. Dale Carrick (Hearts) right footed shot from outside the box is too high.
Substitution
Substitution, Hearts. Brad McKay replaces Callum Paterson because of an injury.
Post update
Gabriel Piccolo (Partick Thistle) wins a free kick on the left wing.
Post update
Foul by Dale Carrick (Hearts).
Post update
Attempt missed. Aaron Taylor-Sinclair (Partick Thistle) left footed shot from outside the box is too high.
Substitution
Substitution, Partick Thistle. Gabriel Piccolo replaces Kallum Higginbotham.
Post update
Jordan McMillan (Partick Thistle) wins a free kick on the right wing.
Post update
Foul by Jamie Walker (Hearts).
Substitution
Substitution, Partick Thistle. Kris Doolan replaces Lyle Taylor.
Booking
Callum Paterson (Hearts) is shown the yellow card.
Post update
Foul by Callum Paterson (Hearts).
Post update
Aaron Taylor-Sinclair (Partick Thistle) wins a free kick in the defensive half.
Booking
Kallum Higginbotham (Partick Thistle) is shown the yellow card.
Goal!
Goal! Hearts 2, Partick Thistle 4. Kallum Higginbotham (Partick Thistle) right footed shot from the right side of the box to the centre of the goal.