Lawrence Shankland scored an 89th-minute penalty winner as 10-man Hearts beat Motherwell 3-2 in a Tynecastle thriller.
Andy Halliday scored either side of half-time to make it four goals in four matches for the left-back after Hearts team-mate Jorge Grant had been sent off in the 38th minute.
Motherwell fought back after Louis Moult came off the bench to hit his first goal since his return on loan on transfer deadline day and Blair Spittal finished off an excellent move to level in the 79th minute.
But the visitors could not build on their equaliser and Shankland scored his 12th goal of the season after Sondre Solholm was penalised for handball.
Both sides showed an attacking intent from the start and Shankland threatened three times in quick succession around the 12-minute mark. Liam Kelly stopped his attempted lob and saved a header either side of another header being blocked by Grant in the goalmouth.
Motherwell lost Paul McGinn to injury with Stephen O’Donnell a natural replacement. Hearts soon attacked the right-back’s area and Robert Snodgrass set up Halliday but Kelly pushed over the former Rangers player’s strike.
Motherwell had a decent chance after winning the ball high up the park but Kevin van Veen shot wide from 20 yards.
O’Donnell’s driven passback put Kelly in trouble but the goalkeeper saved well from Cammy Devlin, who sliced the rebound over.
The chances kept coming. Motherwell defender Rickie Lamie saw his header diverted just wide off Toby Sibbick and Callum Slattery glanced a header wide from a brilliant delivery from Spittal.
Referee Kevin Clancy was quick to show a red card to Grant after he caught Slattery on the follow-through following a lunging tackle. Craig Gordon was booked after running to the halfway line to remonstrate but the decision stood after a relatively swift VAR check.
Before the game could settle down, Hearts were ahead. Halliday had a header diverted wide from a Snodgrass corner before scoring from the next one, looping a header over Matt Penney on the line in stoppage time.
The home side were celebrating again about 70 seconds into the second half when the former Rangers player ran on to McKay’s inside pass and swept a first-time shot inside the far post.
Shankland was not far away with an effort from the centre circle after Motherwell exposed themselves following a corner and van Veen had an ambitious strike of his own saved.
Moult came on for Connor Shields in the 55th minute and netted six minutes later after being brought down by Gordon having reached Penney’s pass first. The goalkeeper was incredulous that a VAR check did not exonerate him but he escaped a second yellow card. Moult was booked after pushing Alex Cochrane in his attempt to speed up the restart.
Gordon was soon beaten by a brilliant volley from Van Veen but the Dutchman was flagged offside from a Sean Goss delivery.
Hearts survived a VAR check for a handball appeal against Sibbick but Motherwell pegged them back following a lengthy passing move which ended with Spittal sliding in to convert Stuart McKinstry’s low cross.
Hearts wanted the teams evened up when McKinstry fouled Cochrane seconds after being booked but Clancy ignored the calls.
The 10 men found extra reserves of energy following their midweek trip to Istanbul and Solholm was penalised after Cochrane’s cross hit his arm.
Shankland sent Kelly the wrong way from the spot and Gordon made sure of the points with an acrobatic stop from a Goss volley.