Match ends, Dundee 1, Ayr United 3.
Ayr United stunned Dundee at Dens Park to earn new manager David Hopkin a first Scottish Championship win at the second attempt.
Mark McKenzie, on his 32nd appearance, opened his Ayr account with a double either side of Cammy Smith's close-range strike early in the second half.
Dundee's Danny Mullen sent a header off the post at 2-0 before Osman Sow netted a late consolation.
The hosts remain in the top four on goal difference.
Ayr - beaten by Hearts in former Livingston and Morton boss Hopkin's debut - are three points clear of the relegation zone and three adrift of the promotion play-offs.
They repelled early pressure before taking the lead when Luke McCowan dispossessed Paul McGowan and teed up 20-year-old McKenzie.
Smith finished off great play by Patrick Reading to double the lead before McKenzie's superb strike put Ayr out of sight.
Sow was played in by Paul McMullan to reduce the deficit, but Dundee were condemned to a second home defeat of the season.
- 26AdamBooked at 45mins
- 10McGowanSubstituted forSowat 54'minutes
- 9MullenSubstituted forMcDaidat 54'minutes
- 35CummingsSubstituted forAfolabiat 63'minutes
- 1SinisaloBooked at 71mins
- 11McCowanSubstituted forWalshat 86'minutes
- 8MillerSubstituted forMoffatat 78'minutes
- 14SmithSubstituted forMurdochat 70'minutes
- 22McKenzieBooked at 65mins
- Alan Newlands
- Shots on Target
Second Half ends, Dundee 1, Ayr United 3.
Foul by Declan McDaid (Dundee).
Jordan Houston (Ayr United) wins a free kick in the defensive half.
Hand ball by Paul McMullan (Dundee).
Attempt missed. Osman Sow (Dundee) right footed shot from the right side of the six yard box is just a bit too high.
Corner, Dundee. Conceded by Patrick Reading.
Goal! Dundee 1, Ayr United 3. Osman Sow (Dundee) right footed shot from the centre of the box to the bottom right corner. Assisted by Charlie Adam.
Substitution, Ayr United. Tom Walsh replaces Luke McCowan.
Goal! Dundee 0, Ayr United 3. Mark McKenzie (Ayr United) right footed shot from outside the box to the top left corner. Assisted by Michael Moffat.
Corner, Dundee. Conceded by Corrie Ndaba.
Attempt missed. Luke McCowan (Ayr United) left footed shot from the right side of the box is close, but misses to the left.
Substitution, Ayr United. Michael Moffat replaces Michael Miller.
Attempt saved. Declan McDaid (Dundee) right footed shot from outside the box is saved in the top right corner.
Attempt missed. Osman Sow (Dundee) left footed shot from outside the box is too high.
Viljami Sinisalo (Ayr United) is shown the yellow card.
Substitution, Ayr United. Andy Murdoch replaces Cammy Smith.
Max Anderson (Dundee) wins a free kick on the left wing.
Foul by Patrick Reading (Ayr United).
Paul McMullan (Dundee) wins a free kick in the attacking half.