Kerr Waddell scored twice to overcome Hearts' resistance and earn Dundee's second league win of the season.

The defender headed two corner kicks past Hearts goalkeeper Jon McLaughlin at the end of both halves in an evenly-matched game.

Hearts thought they had done enough to earn a point when Kyle Lafferty equalised after the interval.

The striker intercepted Sofien Moussa's short pass back and rounded Dundee goalkeeper Scott Bain to score.

Lafferty's goal put a difficult week behind him, after the Northern Ireland international admitted to suffering a gambling addiction.

The most prominent figure at Dens Park, though, was 19-year-old Waddell, who converted two corner kicks with powerful headers to register his first goals for the club.

Lafferty missed last week's draw with Partick Thistle due to a back injury, but as early as the third minute showed his eye for goal, but an effort from 25 yards drifted wide.

Hearts striker Kyle Lafferty rounded Dundee goalkeeper Scott Bain to score his side's second-half equaliser

The visitors were dealt a blow three minutes later when centre-back Aaron Hughes pulled up with what looked like a hamstring injury, and was quickly replaced by midfielder Prince Buaben.

The home side were intent on playing the ball out from the back through their defence, but it almost cost them dearly. Bain played the ball short to Jack Hendry, who returned the ball to the keeper but his clearance came off the advancing Jamie Walker and luckily for Dundee it drifted just wide.

Harry Cochrane, who at 16 was making his Hearts debut, certainly did not look out of place in midfield as he went toe-to-toe with the experienced Paul McGowan.

Chances were few and far between in the first half and a set play was to prove pivotal in breaking the deadlock just before the break. Kevin Holt floated in a corner from the left and Waddell leapt high to nod the ball into the bottom corner.

Hearts midfielder Harry Cochrane made his debut for the club against Dundee, aged 16

Isma Goncalves was looking the sharpest of the Hearts' strikers and only Bain's feet denied the visitors an equaliser as he bore down on goal.

The 2,091 Hearts fans inside the crowd of 7,028 were looking for much more from their team and on the hour mark only the woodwork stopped them drawing level.

Goncalves latched onto a long ball and burst free of Holt, but his thunderbolt of a shot crashed off the apex of post and bar.

With 20 minutes left, the visitors were handed an equaliser after some horrendous defending. Dundee striker Moussa had the ball under control on the halfway line but inexplicably attempted to pass it back to his goalkeeper. Lafferty read the play and intercepted the ball before rounding Bain and sliding the ball home.

Hearts defender Aaron Hughes had to be replaced due to injury early in the game

The goal gave the visitors a real boost and Walker warmed the palms of Bain with a shot as the Tynecastle club pushed forward for a winner.

Hearts substitute David Milinkovic also came close with an effort from the edge of the 18-yard box and Lafferty found the side netting from a difficult angle.

With five minutes of time added on by referee Steven McLean, both sides fancied a winner and it was the home side who were to end Craig Levein's unbeaten run as Hearts manager.

It was a carbon copy of the opener. A corner floated in from the left was met by the head of Waddell, who nodded the ball into the corner to secure all three points.

Post-match reaction

Dundee manager Neil McCann: "In the first half we were excellent. We played a three [at the back] for the first time. We worked on it all week and although the crowd were really nervous I was really cool and calm with it. Eventually Hearts really struggled with it.

"[Waddell] is so good in the air. There are not many better headers of the ball in Scotland. And this kid is just going to get better and better. He was feeling the pace a wee bit and I told him to dig in and he gave me the big giant thumbs up to say that he would and I'm delighted he did because he has come up and given us three points."

"[Moussa] is really upset about making the mistake because the big man is a winner. Sometimes you get a rush of blood and make a big mistake and hope that someone can get me out of trouble and it is a super finish by Kyle [Lafferty] but that mistake was addressed when I went into the dressing room and now it's forgotten about."

Hearts manager Craig Levein: "The two goals were dreadful. Very basic. Just mark your man at a corner and we didn't do it twice. And it's cost us. The lads are disappointed but people have to take responsibility and be reliable in those situations. Two moments of indecision. The players argue they were blocked but that happens. Everybody is doing it so you just need to ensure that doesn't happen.

"I was happy with them all, particularly the second half with the change of shape helping. But that's what makes this so sickening. To lose two goals from set pieces was a nonsense. There is no excuses.

"Like everybody else, [Cochrane] took a little bit of time to get into the game. I thought as the game wore on he got better. He will be a very good player for Hearts in time. I had hoped we would make this a day to remember for the young boy by winning but you don't always get what you deserve ."