The spell has been broken.

The eight-game winning run that had added to Aberdeen being talked up as genuine title contenders was brought to an end by a spirited Dundee in an absorbing game in which two late goals from the home side forced them in the end to battle for their point.

Despite a first half in which they had to weather a storm of attacking play from an impressive Aberdeen side, the Dark Blues had the backbone to retain their equilibrium.

First-half goals from Gary Irvine and Greg Stewart cancelled out David Goodwillie's early breakthrough. They silenced a huge home support and challenged the home side to dig deep to resolve a difficult situation, one made worse when Gary Harkins struck early in the second half to carve out a 3-1 lead for Paul Hartley's side.

A late Jonny Hayes penalty, however, was followed by Ryan Jack's equaliser moments before the final whistle was no more than Aberdeen deserved with manager Derek McInnes insisting that, had the game last five more minutes, his side would have emerged victorious.

"I couldn't have been more proud of my players for the way they kept going," he said. "They showed real perseverance, real determination. They could easily have chucked it at 3-1 and written the day off, but it could be a very important point for us. The never-say-die attitude of my players was really refreshing for me, though I'm not surprised by it."

It took Aberdeen just seven minutes to open the scoring as Niall McGinn hustled Irvine off the ball and fed Adam Rooney down the right. Goodwillie was waiting in the area to finish the manoeuvre with aplomb, his strike too forceful for Scott Bain.

However, Stewart's stinging strike minutes later, which was stopped at the near post by Dons keeper Scott Brown reminded the home side they could be in for a fight.

McInnes, while pleased with Aberdeen's direct and attractive passing game, would have been irked at a penchant for tossing aside clear scoring opportunities, notably when Peter Pawlett's break allowed Goodwillie to find Hayes in front of goal. His shot, from six yards, was blocked by Bain before Rooney blasted the loose ball high from a similar distance.

This was eye-catching football from the Dons, but those two quick Dundee goals towards the end of the first 45 minutes punished such profligacy.

The first, in the 38th minute, was the result of hesitancy in the home defence as Ash Taylor and Shay Logan stood off Irvine, allowing the Dundee left-back to take the ball into the area then fire it past Brown.

Two minutes later, the Pittodrie keeper was picking the ball from the back of his net again as Stewart, who signed a new deal at Dens Park earlier in the week, was given space to race into the area and leave Brown helpless as he hit a second.

Rooney's weak, close-range shot against the Dundee post moments after the break did nothing to dent the visitors' appetite to increase their lead and within three minutes of the re-start Harkins' bullet of a strike from 15 yards proved unstoppable and the Dens Parkers appeared unwilling to loosen their grip on this compelling game.

Taylor's enforced departure after an hour due to injury - he left Pittodrie on crutches - left McInnes to re-shuffle his pack with Andrew Considine moving to centre-back, Hayes to left-back and Willo Flood deployed from the substitutes' bench and into midfield while Cammy Smith replaced Pawlett, who seemed not to have recovered from a first- half injury.

There was a predictable picture as the minutes ticked by, the Dons pressing to find their spirit level as the visitors held firm, unfazed even when Goodwillie smacked a ferocious strike off Bain's left-hand post five minutes from the end.

Hayes' sweetly-struck penalty kick three minutes from the end after Kostadin Gadzhalov had felled Lawrence Shankland in the area went someway towards the target of a point and when Jack emerged from a dozen bodies packed into the Dundee area as additional time was played out, he found a way through with his strike to allow his side to boast nine games without defeat.

Dundee manager Hartley conceded that his team have turned their backs on what should have been a victory. He said: "When you're 3-1 up with 10 minutes to go you think the game's won, but it lasted for 94 minutes in this case. I am so disappointed for the players who put so much into it and we were in control and limited Aberdeen to very few opportunities.

"We came with a game plan and it was probably the best away performance seen at Pittodrie this season. I thought that overall we were great, but we just switched off in the last 10 minutes and they were given a lift with their penalty. But we showed we're a good team."