Hearts face a final-day showdown for Scottish Premiership glory after the twists and turns continued.
The Jambos, who have led the way virtually all season, had to win and hope Celtic lost to ensure an historic night at Tynecastle Park.
But they will have to do it at Parkhead on Saturday, live on Your Site, after a stoppage-time penalty saw the Hoops win at Fir Park.
It was a nervy start for the Jambos, who were spared by the offside flag early on when Calvin Miller curled the ball into the net for the Bairns.
Frankie Kent nodded in the opener as Tynecastle erupted with Cammy Devlin adding another before the break. Blair Spittal then increased what could be a vital goal difference with a second-half stunner.
The fans were on an emotional rollercoaster as the goals filtered through from Fir Park, but Derek McInnes' side are one point clear of Celtic, as they chase their first title since 1960.
Hearts are unbeaten in the league at home and are yet to lose to Celtic this season.
They struggled in the opening stages under the lights in Gorgie, but the nerves settled when Kent nodded past Nicky Hogarth.
When Devlin doubled their lead and it looked like it was going to be the night Hearts fans have been dreaming of.
News of Celtic taking the lead in Lanarkshire calmed the party, but Motherwell's leveller and Spittal's brilliant finish into the bottom corner saw the noise levels ramp up again.
But the season like no other offered more drama as the Hoops late penalty saw them snatch a late win to set up an epic title decider.