Ethan Hamilton’s stunning strike six minutes from time saw Dundee close the gap on 10-man Aberdeen to a single point as Steven Pressley’s side look to pull away from the William Hill Premiership drop zone.

The home side had looked the better of the two teams in the early stages and went in front thanks to Toyosi Olusanya’s first Dons goal.

But a red card for Liam Morrison after 39 minutes allowed Simon Murray to level from the penalty spot and gave Dundee a man advantage which they would not waste.

Joel Cotterill’s close-range finish put them in front at the break, only for Kevin Nisbet’s free-kick to level the scores before Hamilton scored the winner from 25 yards to move his side six points clear of 11th-placed Kilmarnock.

The Dons started in lively fashion and could have taken the lead in the opening minute as Lyall Cameron charged down a clearance from Dundee goalkeeper Jon McCracken, with Nisbet heading wide of the target.

The home side took a deserved lead after 13 minutes. A neat move down the left saw Topi Keskinen play in Nisbet who saw McCracken palm his shot in the air, and Olusanya was on hand to make sure the ball crossed the line.

The Dons had the ball in the net again three minutes later as Nisbet turned home after a Cameron free-kick, but referee Steven McLean ruled the set piece had been taken too quickly.

But the game would swing in Dundee’s favour after 33 minutes when Murray’s nudge on Morrison sent the on-loan defender into Tony Yogane to give the visitors a penalty.

It looked a soft award and was reviewed extensively by VAR before the penalty was confirmed, and Morrison was shown a red card for denying a goalscoring opportunity.

After six minutes of debate, Murray drilled high to the left over goalkeeper Per Kristian Bratveit who had gone the right way.

The visitors built from there and went ahead on the stroke of half-time. Cameron Congreve was given time to shift on to his left foot and drill through the legs of Bratveit, who recovered to punch the ball off the line but only into the body of Cotterill who gladly took the acclaim.

Aberdeen altered their shape at the break, and while Dundee were able to pick out spaces, it was an even opening to the half.

The visitors began to threaten around the hour mark, with Bratveit unconvincing in dealing with a Yan Dhanda effort, though his save from an offside Murray a minute later was much more assured.

Drey Wright headed wide from close range before Bratveit palmed another Dhanda effort over the bar.

But it would be the Dons who netted next, and in some style. Dhanda’s foul on Cameron gave Aberdeen a free-kick 25 yards out, and Nisbet let fly with a stunning effort into the top-left corner.

Dundee responded well and Yogane found himself through on goal only to be denied by a last-ditch Tom McIntyre challenge.

And they went back ahead when Hamilton moved the ball on to his left foot and unleashed an unstoppable 25-yard strike past a helpless Bratveit.