Three goals in quick succession gave Hearts an unlikely win over Ross County at Tynecastle.
Steffen Wohlfarth's impressive strike put the visitors in front.
Michael Ngoo nodded Hearts level just after the break only for Wohlfarth to regain the lead for the Staggies with a powerful header of his own.
But Jason Holt equalised with a stunning volley, Evangelos Ikonomou's own goal put the hosts ahead and Ngoo netted his second with a low strike.
County remain six points off a European spot and Hearts' win may also have implications for Dundee, who could be relegated later on Saturday depending on results.
Wohlfarth was keen to make his presence known and an early shot from the German ricocheted up off a defender before his eventual header was collected by Jamie MacDonald.
But the goalkeeper was helpless midway through the half as Wohlfarth collected near the byeline, burst past Jamie Hamill and swept a powerful shot into the far corner from the inside left channel.
And Ivan Sproule should have doubled the visitors' lead when he pounced upon a short passback by Brad McKay.
The former Hibernian winger was clean through but struck straight at MacDonald, who clawed away the rebound before Wohlfarth could capitalise.
Kevin McHattie came close to a leveller when he moved upfield to fire a shot off the outside of the right-hand post but County were soon back on the attack.
Sproule turned Mihael Kovacevic's low centre towards goal and MacDonald again scrambled clear.
After such a dominant first half, the lack of a second goal may have been a concern for the travelling fans.
And their fear of a Hearts comeback was realised as Ngoo rose above the County defence to direct McHattie's cross past Michael Fraser.
However, another powerful header, this time by Wohlfarth, edged Derek Adams' side back into the lead as Iain Vigurs' inviting corner was dispatched into the net.
Jamie Walker, Holt and Danny Wilson could not hit the target as Hearts tried to battle back a second time.
But Holt eventually beat MacDonald with a stunning left-foot volley after a corner had been cleared to the edge of the box.
And, within seconds, Ikonomou turned the ball into his own net after Walker had nudged the ball towards goal.
Ngoo then beat Fraser at his near post with a low driven shot and Hearts fans were savouring the prospect of victory a matter of minutes after contemplating defeat.
Kovacevic could have set up an interesting last few minutes but lifted his shot over with the goal gaping.
Live Text Commentary
Full Time The game is over, as the referee blows his whistle.90:00 +0:47
Short corner taken by Jamie Walker from the left by-line.89:50
Iain Vigurs takes a shot. Save by Jamie MacDonald.87:17
Michael Ngoo gives away a free kick for an unfair challenge on Richard Brittain. Grant Munro takes the free kick.86:15 Substitution
Substitution (Ross County) makes a substitution, with Gary Glen coming on for Paul Lawson.86:15 Substitution
Substitution Andre Hainault is brought on as a substitute for Scott Boyd.85:30
Free kick taken by Jamie Walker.85:30 Booking
Booking Paul Lawson is given a yellow card.85:17
Foul by Paul Lawson on Michael Ngoo, free kick awarded.84:22
Ivan Sproule takes a shot. Jamie MacDonald makes a save. Mihael Kovacevic produces a left-footed shot from inside the area that clears the bar.83:22
Assist by John Sutton.83:22 Goal scored
Goal! - Michael Ngoo - Hearts 4 - 2 Ross Co Goal scored by Michael Ngoo from inside the box to the bottom right corner of the goal. Hearts 4-2 Ross County.82:22
Jason Holt fouled by Steffen Wohlfarth, the ref awards a free kick. Jamie Hamill takes the direct free kick.79:54 Goal scored
Goal! - Evangelos Ikonomou - Hearts 3 - 2 Ross Co Evangelos Ikonomou puts the ball into his own net. Hearts 3-2 Ross County.78:45 Goal scored
Goal! - Jason Holt - Hearts 2 - 2 Ross Co Jason Holt finds the back of the net with a goal from just inside the area to the bottom right corner of the goal. Hearts 2-2 Ross County.78:06 +1:00 Booking
Booking Scott Boyd is shown a yellow card for unsporting behaviour.74:57 Substitution
Substitution Martin Scott comes on in place of Rocco Quinn.74:57
Iain Vigurs produces a right-footed shot from inside the area that clears the crossbar.73:17
Jamie Walker takes a short corner. Corner taken short by Jamie Walker. Headed effort from deep inside the penalty area by Danny Wilson goes harmlessly over the crossbar.72:46
Rocco Quinn is flagged offside by the assistant referee. Jamie MacDonald takes the free kick.
Free kick taken by Kevin McHattie. The assistant referee flags for offside against Michael Ngoo. Direct free kick taken by Michael Fraser.70:04 Substitution
Substitution (Hearts) makes a substitution, with John Sutton coming on for Dale Carrick.70:04
Free kick awarded for a foul by Scott Boyd on Michael Ngoo.69:38
Mihael Kovacevic fouled by Ryan Stevenson, the ref awards a free kick. Michael Fraser takes the free kick.68:40
The referee blows for offside. Jamie MacDonald restarts play with the free kick.65:21
Ryan Stevenson gives away a free kick for an unfair challenge on Steffen Wohlfarth. Iain Vigurs produces a strike on goal direct from the free kick.64:22
The ball is sent over by Jamie Hamill, Paul Lawson manages to make a clearance.63:53
Steffen Wohlfarth is flagged offside by the assistant referee. Danny Wilson restarts play with the free kick.62:20
Effort from 25 yards by Arvydas Novikovas.60:36
Corner taken by Kevin McHattie, Header from deep inside the penalty area by Brad McKay goes harmlessly over the crossbar.60:08
Corner taken left-footed by Kevin McHattie from the left by-line to the near post, Evangelos Ikonomou makes a clearance.58:43
Ivan Sproule is caught offside. Jamie MacDonald restarts play with the free kick.57:34
Free kick awarded for an unfair challenge on Rocco Quinn by Jason Holt. The ball is swung over by Paul Lawson, Iain Vigurs takes a shot. Comfortable save by Jamie MacDonald.56:46
The ball is sent over by Ryan Stevenson, Jason Holt has an effort from just inside the box that misses to the left of the target.56:19
The ball is sent over by Brad McKay, Jamie Walker has a volleyed shot.55:52
Inswinging corner taken from the left by-line by Jamie Walker.54:40
Inswinging corner taken from the left by-line by Paul Lawson, Brad McKay makes a clearance.53:41
Assist on the goal came from Iain Vigurs.53:41 Goal scored
Goal! - Steffen Wohlfarth - Hearts 1 - 2 Ross Co Steffen Wohlfarth grabs a headed goal from inside the six-yard box. Hearts 1-2 Ross County.53:21
Corner taken left-footed by Iain Vigurs from the right by-line,51:49
Iain Vigurs crosses the ball in from the free kick.51:49 Booking
Booking Michael Ngoo receives a yellow card for unsporting behaviour.51:45
Michael Ngoo is adjudged to have handled the ball.50:33
Iain Vigurs concedes a free kick for a foul on Jamie Walker. Direct free kick taken by Jamie MacDonald.48:51
Assist on the goal came from Kevin McHattie.48:51 Goal scored
Goal! - Michael Ngoo - Hearts 1 - 1 Ross Co Michael Ngoo finds the back of the net with a headed goal from close range. Hearts 1-1 Ross County.48:48
Centre by Kevin McHattie,47:32
Paul Lawson takes a weak shot and went wide right of the goal.47:26
Evangelos Ikonomou crosses the ball, Brad McKay manages to make a clearance.45:17
Richard Brittain produces a right-footed shot from just outside the box that goes wide left of the goal.45:01
The game restarts for the second half.45:01 Substitution
Substitution Jason Holt joins the action as a substitute, replacing Callum Tapping.45:01 Substitution
Substitution Arvydas Novikovas on for Mehdi Taouil.45:00 +0:05 Half time
Half Time It is the end of the first-half.42:50
Dale Carrick fouled by Evangelos Ikonomou, the ref awards a free kick. Ryan Stevenson has a direct shot on goal from the free kick. Callum Tapping has a shot on goal from outside the area which misses right.41:58
Corner taken by Kevin McHattie from the right by-line.40:44
Richard Brittain gives away a free kick for an unfair challenge on Kevin McHattie. Kevin McHattie crosses the ball in from the free kick, Rocco Quinn makes a clearance.35:58
Ivan Sproule takes a shot. Save by Jamie MacDonald.34:27
Kevin McHattie takes a fantastic shot and bounced off the post.33:00
Michael Ngoo challenges Evangelos Ikonomou unfairly and gives away a free kick. The free kick is delivered right-footed by Richard Brittain from left wing, comfortable save by Jamie MacDonald.31:10
Effort on goal by Rocco Quinn from 20 yards. Save made by Jamie MacDonald.29:27
Dale Carrick has an effort at goal from close range which goes wide of the left-hand upright.28:40
Free kick awarded for an unfair challenge on Dale Carrick by Evangelos Ikonomou. Jamie MacDonald takes the direct free kick.28:04
Inswinging corner taken right-footed by Paul Lawson from the left by-line, clearance made by Michael Ngoo.27:33
Foul by Ryan Stevenson on Paul Lawson, free kick awarded. Michael Fraser restarts play with the free kick.25:57
Ivan Sproule takes a shot. Save made by Jamie MacDonald.24:51
Scott Boyd fouled by Michael Ngoo, the ref awards a free kick. Direct free kick taken by Scott Boyd.23:31
Shot by Jamie Walker from just outside the area goes over the net.23:02
Ivan Sproule crosses the ball, Brad McKay makes a clearance.21:20 Goal scored
Goal! - Steffen Wohlfarth - Hearts 0 - 1 Ross Co Steffen Wohlfarth fires in a goal from deep inside the penalty box to the top right corner of the goal. Hearts 0-1 Ross County.20:09
Free kick awarded for an unfair challenge on Richard Brittain by Callum Tapping.19:57
Free kick crossed right-footed by Richard Brittain, clearance made by Michael Ngoo.19:57 Booking
Booking Callum Tapping is given a yellow card.19:15
Shot from 25 yards by Jamie Walker. Comfortable save by Michael Fraser.18:40
Inswinging corner taken from the right by-line by Kevin McHattie.17:54
Jamie Walker produces a cross, Grant Munro makes a clearance.17:11
Shot from outside the box by Evangelos Ikonomou misses to the left of the target.16:07
Steffen Wohlfarth concedes a free kick for a foul on Danny Wilson. Jamie MacDonald takes the free kick.14:55
Free kick awarded for a foul by Rocco Quinn on Mehdi Taouil. Free kick taken by Jamie Hamill.12:00
Iain Vigurs gives away a free kick for an unfair challenge on Jamie Walker. Free kick taken by Kevin McHattie.10:13
The ball is sent over by Ivan Sproule, Steffen Wohlfarth takes a shot. Danny Wilson manages to make a clearance.9:43
The offside flag is raised against Dale Carrick. Free kick taken by Grant Munro.7:25
Inswinging corner taken right-footed by Jamie Walker from the left by-line, Close range header by Brad McKay goes over the bar.7:06
Inswinging corner taken right-footed by Jamie Walker from the left by-line, clearance made by Evangelos Ikonomou.6:57
The ball is swung over by Jamie Walker, clearance by Scott Boyd.4:53
Foul by Michael Ngoo on Scott Boyd, free kick awarded. Free kick taken by Scott Boyd.4:20
The ball is crossed by Paul Lawson.2:55
The ball is delivered by Paul Lawson, save by Jamie MacDonald.2:09
Michael Ngoo crosses the ball, Evangelos Ikonomou makes a clearance.1:53
Free kick awarded for a foul by Richard Brittain on Jamie Walker. Danny Wilson takes the direct free kick.1:32
The ball is sent over by Jamie Hamill, save by Michael Fraser.0:32
Ryan Stevenson sends in a cross, Mihael Kovacevic makes a clearance.0:00
The ref blows the whistle to start the match.
Live data and text provided by our data suppliers