Last updated on .From the section Scottish Premiership

Ryan Hedges hammered in an emphatic late goal as Aberdeen came from behind to win a fractious Scottish Premiership contest with Hearts.

The substitute smashed in his first for the club with five minutes remaining, adding to a Sam Cosgrove double.

Steven Naismith had levelled with his first touch after coming on and Hearts briefly led through Jamie Walker.

Aaron Hickey was then sent off for the visitors before Cosgrove's second from the spot and Hedges' cracking finish.

Cosgrove now has eight goals in five games as Aberdeen opened their league campaign with a fourth successive home win against Hearts.

Hearts' hit back then falter after dismissal

The introduction of Naismith, who has been out since February through injury, appeared to have swung the game in Hearts' favour.

Fresh from signing a four-year deal to stay at Tynecastle, the Scotland forward powered in a diving header after a throw-in had been flicked on. He was also involved as Walker poked a shot beyond Joe Lewis to make it 2-1 to the Edinburgh side on 76 minutes.

However, the dismissal of 17-year-old full-back Hickey handed the initiative to the home side for a rousing finale and a crazy challenge from Clevid Dikamona gifted them a penalty, converted by the red-hot Cosgrove.

The striker, full of confidence after a midweek hat-trick in Europe, had scored the only goal of the first half, racing away from Christophe Berra and slipping in an angled shot with goalkeeper Bobby Zlamal reluctant to leave his line.

The best goal of a breathless afternoon was saved for last though as Hedges, on as a second-half replacement, timed his run perfectly to meet a low cross from Greg Leigh and blazed in an unstoppable strike from near the penalty spot.

The Welsh winger was shown the ninth yellow card of the afternoon by referee Don Robertson after his exuberant celebrations. Two of those were for Hickey, who cynically clipped the heels of Scott Wright in the first half before crashing into Niall McGinn soon after his side had gone in front.

The foul count began to rise after an enthralling first 20 minutes, which included Cosgrove's opener, an outstanding save from Joe Lewis to keep out a Berra header and Zlamal pushing away a venomous effort from Jon Gallagher.

Bad-tempered challenges disrupted the flow of the game for a long stretch before Naismith's dramatic arrival and the merry bedlam that followed.

Steven Naismith dives in to head Hearts level at Pittodrie

Man of the match - Sam Cosgrove

BBC Scotland's Stephen Couse at Pittodrie

Cosgrove was the difference, scoring his seventh and eighth goals of the season. He was assured for his first goal, coolly converting from a tight angle, and was confident from the spot, after Dikamona's foolishness gave Aberdeen a golden chance to equalise.

He was a physical presence upfront throughout, much like Uche Ikpeazu at the other end, but unlike his Hearts counterpart, he was able to create chances for himself and was brimming with confidence.

Gallagher was a strong contender for a superb first-half performance full of strong running and Joe Lewis played his part with a stunning first-half save but Sam 'Ballon d'Or' Cosgrove was the hero of the day once again.

A man on form - stats

'We found a way to win' - reaction

Aberdeen manager Derek McInnes: "The resolve and the spirit was clear and even after getting the equaliser you would have forgiven my players for thinking we'd take a draw. But there was no let up.

"That was a team that were on their knees but still finding a way to win. That's why I'm excited about this campaign."

Hearts manager Craig Levein: "Even if we had come away with 2-2, I'd still be a little bit disappointed because I felt that we deserved more than that.

"The extra man made a difference. Clevid made a stupid decision to leave a foot in at the penalty area when he didn't need to. And that has cost us. So I'm ruing those silly decisions that we made."