Aberdeen’s title hopes suffered a hammer blow as they were defeated by determined Inverness Caley Thistle.
Adam Rooney shot Aberdeen into an early lead but Iain Vigurs levelled soon after following an Ash Taylor mistake.
Taylor was then harshly penalised for a high challenge on Ross Draper, with Greg Tansey tucking away the spot-kick.
The unfortunate Taylor then touched the ball on for Carl Tremarco to head in a third before the Dons had two penalty claims rejected.
The end of Aberdeen’s 12-game unbeaten run leaves Derek McInnes’ side three points behind Premiership leaders Celtic, who have a game in hand and a vastly superior goal difference.
The Dons were looking for their first win over Inverness in three attempts this season and made a strong start.
Former Caley Thistle defender Graeme Shinnie drove in from the left and thundered in a shot which Owain Fon Williams touched onto the bar without Willie Collum noticing.
It was not the last time the referee would upset the visitors.
Moments later, however, Craig Storie burned through the home defence with a fabulous driving run and provided a lovely weighted pass for Rooney to slam home via a flick off defender Danny Devine.
Then came the first of Taylor’s errors and the game was all square.
Liam Polworth tried to thread a ball in to Miles Storey but Taylor was always getting there first, only for the defender’s clumsy touch to allow Vigurs to tuck the ball home home with a composed finish.
Aberdeen’s Niall McGinn curled a free kick wide of the target before Tremarco nodded wide from close range after a corner squeezed through a cluster of players to reach him at the back post.
The visitors’ plans were disrupted when they lost winger Jonny Hayes with what looked like a hamstring injury and they were relieved when Tansey, a target for Aberdeen in the transfer window, blasted a curling free-kick narrowly away from the top corner.
Tansey hit the net six minutes into the second half with a cool spot-kick after the game exploded into life with a controversial decision from Collum.
Draper executed a one-two and got the slightest touch on the ball as both he and Taylor raised their feet high in the air, with the home player then crashing to the turf without any apparent contact.
Aberdeen were rattled by the decision and by the hosts’ fierce pressing. Rooney attempted an overhead kick from close range but could not connect properly.
Maximum points and a place in the top half of the table were secured for Inverness when the impressive Miles Storey dinked a ball into the six-yard box and a stretching Taylor could only steer the ball towards Tremarco, who nodded home at the back post.
Collum’s assistant initially flagged for offside but was correctly overruled by the man in the middle.
Dons duo Shinnie and Taylor felt they should have had penalties after going to ground in a frantic finish but Inverness, who played with a vigour that has been missing for much of the season, held on for a deserved victory.