Aberdeen 2-3 Inverness CT
Aberdeen missed the chance to go top of the Scottish Premier League after losing to Inverness at Pittodrie.
The visitors took the lead when Billy McKay met Andrew Shinnie's cross.
Josh Magennis slotted the ball into the net just before the break to put the home side level and the Northern Irishman chipped a neat second.
But Gary Warren scored a second-half equaliser before a late winner from McKay allowed Inverness to leapfrog the Dons into second place in the table.
Terry Butcher's side move level on points with Scottish Premier League leaders Celtic, who have a superior goal difference and two games in hand.
The home side started brightly and Magennis burst through on the right-hand side and almost sent a low drive through Antonio Roguero's legs, but the keeper managed to recover.
The game descended into a lull as the first-half wore on, but the home fans were rudely awakened when Inverness went ahead through a controversial goal.
Aberdeen fans claimed for a free-kick as Richie Foran challenged Jamie Masson in the midfield area but referee Alan Muir waved play on.
Shinnie crossed from the left and McKay got the slightest of touches to take the ball past Jamie Langfield and into the net.
The home supporters were left incensed again when Rory Fallon went down in the Inverness box as he and Josh Meekings both went up for an aerial ball, Muir again letting play continue.
However, a minute before half-time, their boos turned to cheers when Johnny Hayes cut the ball across the face of goal and Magennis coolly side-footed the ball home.
The referee was given a rapturous welcome for the second half, mainly because he was a different referee. Muir had suffered a calf injury, and was replaced by Craig Charleston - much to the delight of the Aberdeen supporters.
The Dons carved out a couple of early chances as they went looking for a second goal, with Reguero tipping a Joe Shaughnessy header over and Hayes going close with a low, left-footed drive.
And the pressure told when Magennis spun past Meekings and flicked the ball over Reguero to put the home side ahead.
However, Aberdeen then seemed to ease off and Warren connected with Aaron Doran's inswinging corner to bring the visitors level.
Hayes, playing against his former club, was stung into action and took the ball forward from his own right-back area and blasted a shot from 30 yards which went just wide of Reguero's right-hand post.
As the game became stretched in the latter stages, Langfield had to look smart to prevent a Scott Vernon own goal and then deflect a Shinnie shot wide.
And then Shinnie tried to set up Richie Foran when one-on-one with the keeper, but overhit his pass when he should perhaps have taken the chance himself.
Then, with the game seemingly drifting to a draw, Russell Anderson misjudged a long, lofted ball and chested it into the path of McKay, who steered the ball into the back of the net for the winner.