In the opening five minutes Dundee put over a couple of dangerous crosses. Then at the other end, the visitors failed to clear their lines after good pressing from Max Barry, it led to a good opening but Connor Barron blasted over.
On 19 minutes a sharp turn and a shot from Max Anderson had to be dealt with by Mair. A few minutes later the keeper was well positioned to save from Michael Cunningham. The same player on 22 minutes should have given the visitors the lead but he failed to make any contact in the six yard box as the ball was crossed from the right.
It was therefore slightly against the run of play when Aberdeen took the lead on 24 minutes. Kieran Shanks produced a good burst forward and won his team a free kick about 25 yards out.
In a really well worked move, the ball was played deep to Luke Turner who had ghosted round the back and he headed across goal for Connor Power to nod home. Great link up play by the two Irish boys.
The goal lifted the home side and a short time after that left back Tyler Mykyta had a couple of half chances.
Half an hour in, by now Aberdeen were playing some lovely football, typified by Max Barry. He produced a delightful touch on the edge of the area but Jack Chesser could not quite get a shot away. Both midfielders have missed much of the season through injury, so it is good to see them back.
On 34 minutes the young Dons won the first corner which was over hit by Barron. Dundee broke forward and worked an opening for Max Anderson. His shot was parried by Mair and it looked like John Smith was a way to slot home but Power made a brilliant goal saving tackle, just getting their ahead of the Dundee striker.
With five minutes to go Dundee won a free kick 30 yards out. Anderson produced a very good shot which appeared to be heading into the top corner till Archie Mair brilliantly tipped the ball over. The big keeper has been in very good form recently.
It was the visitors who started the second half better and Aberdeen were almost punished when left back Cameron Dow was left in plenty of space but his cross was cut out. On 50 minutes Aberdeen?s left back Mykyta did very well to work an opening but his shot was blocked.
On 52 minutes Dundee equalised. The referee allowed play to continue when he might have awarded a free kick. The ball then fell to striker John Smith inside the area and he dispatched a shot past Mair who had no chance.
65 minutes in and Aberdeen were almost back in front. Right back Danny Strachan put over a great ball for Shanks, his looping header was on target but Harrison Sharp produced a fine save to tip it over.
Two minutes later, Dundee took a free kick which caught out the Dons defence. Again Dow was in space but his shot hit the side netting.
With just under twenty five minutes to go a double change for the Dons. Chesser and Barry were withdrawn and replaced by Michael Dangana and Mark McLauchlan.
With his first touch Dangana almost scored after a great through ball by Duncan but the keeper just got there in time. The tactical change from Aberdeen seemed to work as they enjoyed some dominance for the first time in the second half. Lewis Duncan had shot saved and Tyler Mykyta put a free kick just over.
It was becoming quite a bad tempered game and the referee was forced to issue a number of yellow cards to try and keep some order.
With 20 minutes to go Aberdeen failed to clear a dangerous free kick into the area. The second ball fell to substitute Kyle Fleming and his turn and shot was brilliantly saved by Mair. Dundee continued the attack and again Mair produced a fine save with his feet but the ball fell to Grady McGrath and he fired home what proved to be the winner.
The last 15 minutes saw a lot of crunching tackles and a lot of frantic play. Aberdeen pushed hard for an equaliser but were unable to create anything of note. Credit to Dundee who worked hard to protect their lead and they deserved the win in the end.