Aberdeen beat Inverness 3-2 in a five-goal thriller to register a third straight win at Pittodrie as Caley Thistle relinquished joint top in the Scottish Premiership.

Goals from Adam Rooney and Shay Logan gave the Dons an interval lead after Josh Meekings had headed the Highlanders in front.

Marley Watkins levelled the contest early in the second half but Jonny Hayes struck the winner soon after.

Aberdeen created the first opportunity when Hayes sent David Goodwillie away down the left in the sixth minute. Goodwillie crossed for Rooney but the Irishman, who netted a midweek hat-trick against Livingston in the League Cup, could not keep his 12-yard header down.

Goodwillie had the ball in the net with an overkick in the 12th minute but the assistant referee had already flagged, Mark Reynolds failed to keep Barry Robson's free-kick in play.

The hosts were lively in the early stages and Peter Pawlett went on a lung-bursting run from the halfway line only to be stopped in his tracks in the penalty area by both Meekings and Gary Warren.

However, Inverness broke the deadlock in the 16th minute with a set-piece. Greg Tansey delivered a free-kick from midway inside the Aberdeen half and Meekings rose unchallenged to send an eight-yard header into the top corner.

Goodwillie almost came up with an immediate reply for the Dons, controlling a Logan through-ball but failing to trouble Dean Brill who made a comfortable stop.

It did not take Derek McInnes' men long to draw level though, Rooney pouncing on a Warren mistake in the 24th minute. The central defender could not get enough purchase on his back header to Brill and Rooney nipped in to take the ball around the goalkeeper and slot into an empty net.

Warren nearly atoned for his error two minutes later but saw his near-post header from Aaron Doran's corner hit the woodwork as the hosts again looked suspect from another Caley set play.

Aberdeen looked far more comfortable going forward and they went in front with a well worked goal five minutes before the interval. Pawlett linked with Hayes in the box before picking out Goodwillie, who laid the ball off for Logan to side-foot a 12-yard effort high past Brill.

But the Highlanders, renowned for their fighting spirit, were back on level terms in the 50th minute. Ryan Christie burst into the penalty area and after his shot was blocked by Logan, Watkins was on hand to clip the ball past Jamie Langfield from the edge of the six-yard box.

The Dons rallied again though and restored their advantage just before the hour hark. Following a mistake from Ross Draper, Goodwillie saw a 14-yard shot parried by Brill and Hayes took a touch to steady himself before slotting in the rebound.

Caley had Aberdeen camped inside their own half for spells and were unfortunate not to be awarded a free-kick just outside the box - Barry Robson, who had already been yellow carded, going unpunished for a trip on Graeme Shinnie.

The hosts had to soak up the pressure and play on the counter attack and the tactic almost proved fruitful in the 73rd minute as Willo Flood struck a 20-yard shot just wide of the target.

Both sides made changes in the closing stages, which broke the flow and Aberdeen were able to see out the match to climb to sixth in the table.