Match ends, Aberdeen 0, Hamilton Academical 2.
Aberdeen endured a fifth Scottish Premiership game at Pittodrie without a win after being stunned by struggling Hamilton Academical.
Brian Rice's side, who were thrashed 5-0 by Rangers on Sunday, weathered long spells of pressure from their hosts to move out of the bottom two.
A stunning angled George Oakley strike put the visitors ahead and, despite having numerous chances, Aberdeen fell further behind when Mikel Miller tucked home from Lennard Sowah's cut-back.
The win moves Hamilton above Dundee, who lost at Rangers.
But Derek McInnes' Aberdeen have lost further ground on second-placed Rangers and are just four points ahead of Kilmarnock in fourth, who have a game in hand.
Oakley wonder goal & Miller impresses
Rice said he wanted his players to enjoy themselves, and they did just that. They had lost their previous five away league games without scoring, but they signalled their intentions from the start.
Miller caused all sorts of problems playing in between the lines, and it was his blocked cross which almost led to the opener and, from the resulting corner, Aaron McGowan's in-swinger almost crept in.
The goalkeepers were very much on top in the opening half hour, with Gary Woods comfortably saving Graeme Shinnie's effort before Joe Lewis kept Miller at bay with a crucial save moments later.
That was until just before half-time, when a seemingly harmless ball was floated over the top of the Aberdeen defence and was picked up by Oakley. From a near-impossible angle, he unleashed a half-volley which flew over Lewis and went in off the far post.
Aberdeen had chances to equalise through Greg Stewart and Sam Cosgrove, but a combination of superb goalkeeping by Woods and the Hamilton woodwork kept the visitors ahead.
McInnes' side kept knocking on the door and Cosgrove thought that he had equalised with a close-range effort, only for it to be cleared off the line a few minutes into the second-half.
Despite the Aberdeen pressure, Accies continued to play the same way and had chances of their own, the best of which was spurned by Miller after he took too long to finish.
But the forward did not have to wait long to atone for his error. Sowah recovered the ball deep in the Aberdeen half and then played a one-two with Oakley. As he entered the box, he lifted his head to see Miller totally unmarked on the penalty spot, before passing the ball across for him to confidently double Accies' lead.
Aberdeen continued to seek a way back in to the game but were unable to find a way past the impressive Woods.
Rice inspires 'magnificent' Hamilton - analysis
BBC Scotland's Tyrone Smith at Pittodrie
A lot will be made about how bad a night this was for Aberdeen - and make no mistake this really was - but that shouldn't be allowed to overshadow what was a magnificent performance by Hamilton. In a period of just a few weeks, Rice has instilled something into this side that appeared to be lacking before.
They played with a flair and a freedom that you don't expect to see from a team who are fighting for their lives at the bottom, and the grit and determination that are standard Hamilton traits were also there in abundance. They are now out of the bottom two, and if they continue with this sort of approach, you wouldn't bet against it staying that way.
As for Aberdeen, McInnes must be scratching his head about how a team that have been so good on the road, have now started to find the going so tough in front of their own fans. This result is a huge blow to their hopes of catching Rangers, who they host in the Scottish Cup on Sunday - a game which you feel certainly falls in to the season-defining category.
'We all expect more' - reaction
Aberdeen manager Derek McInnes: 'I'm bitterly disappointed, I think we all expect more, I think the supporters should expect more from an Aberdeen team.
"We had no shortage of effort, we kept going, and ran about enough, but what was lacking for me was a lack of aggression, a lack of confidence in the game, a lack of responsibility in taking chances."
Hamilton head coach Brian Rice: "I'm delighted with the boys; they've taken my ideas on board. We'll have good days and we'll have bad days, but we are like any other team, can we keep reproducing.
"We are into 10th position and we hope it is a springboard to kick us on, but we are under no illusions."
- 21BallSubstituted forMayat 76'minutes
- 4ConsidineBooked at 14mins
- 29LoweSubstituted forDevlinat 18'minutes
- 2McGowanBooked at 63mins
- 25MartinSubstituted forPennyat 90+1'minutes
- 18MacKinnonSubstituted forImrieat 53'minutes
- 22AndreuSubstituted forMcMillanat 90+3'minutes
- 11MillerBooked at 90mins
- Bobby Madden
- Shots on Target
Second Half ends, Aberdeen 0, Hamilton Academical 2.
Mickel Miller (Hamilton Academical) is shown the yellow card for a bad foul.
Scott McKenna (Aberdeen) wins a free kick in the attacking half.
Foul by Mickel Miller (Hamilton Academical).
Attempt missed. Sam Cosgrove (Aberdeen) right footed shot from the centre of the box is too high.
Corner, Aberdeen. Conceded by Ziggy Gordon.
Substitution, Hamilton Academical. David McMillan replaces Tony Andreu.
Attempt blocked. Greg Stewart (Aberdeen) left footed shot from the right side of the box is blocked.
Substitution, Hamilton Academical. Alex Penny replaces Scott Martin.
Foul by Stevie May (Aberdeen).
Lennard Sowah (Hamilton Academical) wins a free kick in the defensive half.
Attempt missed. Connor McLennan (Aberdeen) right footed shot from outside the box is just a bit too high.
Corner, Aberdeen. Conceded by Lennard Sowah.
Corner, Aberdeen. Conceded by Alexander Gogic.
Corner, Aberdeen. Conceded by Alexander Gogic.
Attempt missed. Connor McLennan (Aberdeen) right footed shot from the centre of the box misses to the right.
Sam Cosgrove (Aberdeen) wins a free kick in the defensive half.
Foul by Delphin Tshiembe (Hamilton Academical).
Foul by Lewis Ferguson (Aberdeen).