A Gary Warren double helped give Inverness a win against Hearts in a feisty encounter in the capital.
Hearts bounced back to level twice with goals from Jason Holt and Andy Webster.
But the Highlanders continued to hit back and Billy McKay was also on the scoresheet as Terry Butcher's side returned to second place in the Scottish Premier League table.
The first real chance fell to Webster but the Hearts defender's half-volley sailed over from just five yards out.
The visitors took the lead on 15 minutes and it was a text book set piece.
Aaron Doran curled a free-kick to the six-yard box and Warren out-jumped the Hearts defence to nod the ball down and past Jamie MacDonald.
Their lead was almost doubled minutes later but Owain Tudur Jones' low driven free-kick just crept past the post.
With both sides battling for possession, the game was being stretched from end to end and once again the Highlanders found the net.
This time though McKay was flagged offside before he slotted under MacDonald - it looked pretty tight.
Darren Barr past up a glorious chance to level just after the break. Arvydas Novikovas whipped in a wonderful free-kick, but instead of blasting into the net from six yards Barr swiped at fresh air and looked to the heavens as the ball trundled out.
It was all-square on 55 minutes though thanks to Hearts youngster Holt. He showed poise and composure to shrug off a challenge before unleashing an unstoppable drive past Ryan Esson.
That gave the home fans hope of avoiding their third straight defeat but Caley striker Billy McKay had other ideas.
Just six minutes after the equaliser he duped the Hearts defence to nod in at the back post and give his side the lead once more.
Webster hit back with a deflected equaliser but the visitors just refused to lie down and were ahead once again just minutes later.
Warren grabbed his second and the visitors' third with a bullet header to seal the points and compound