Flavio Paixao nodded the Accies ahead in the opening minute before a James Wesolowski header and a Simon Mensing penalty in the second half ensured the victory.
Richard Foster and Zander Diamond were both shown red cards before Derek Young scored a late consolation.
Jamie Langfield returned to the Aberdeen side after dropping to the bench for last weekend's 1-1 draw with St Johnstone.
Defender Diamond and Charlie Mulgrew were also included in the starting XI after missing out against the Saints through injury and suspension respectively.
Stuart Nelson and Paul Marshall both dropped to the bench while striker Darren Mackie missed out through suspension.
Hamilton, knowing a win would ensure they finished above the Dons, made only one change from the side that defeated Falkirk last weekend with midfielder James McArthur returning at the expense of Mickael Antoine-Curier, who missed out altogether.
Hamilton made a terrific start by breaking the deadlock within 60 seconds.
A deep corner from Dougie Imrie found Flavio Paixao unmarked at the back post and the Portuguese striker calmly nodded the ball beyond Langfield.
The visitors had a strong claim for a penalty waved away after five minutes when Mensing was held back by Foster as he attempted to connect with Flavio Paixao's cross.
A great tackle by Martin Canning prevented Steven MacLean turning home Sone Aluko's inviting delivery after 11 minutes.
Davide Grassi was booked for a robust challenge on Canning after 26 minutes as the game became increasingly heated.
Marco Paixao almost added a second for Hamilton, but his acrobatic overhead kick went inches over the crossbar.
Hamilton goalkeeper Sean Murdoch was rarely tested during the first period, but he had to look sharp to keep out a low MacLean drive just before the break.
The visitors made a bright start to the second period and doubled their advantage four minutes after the restart when Imrie's cross found Wesolowski, whose angled header gave Langfield no chance.
Hamilton found the back of the net for a third time after 55 minutes when Imrie volleyed home but the goal was ruled out for offside.
However, the Accies did increase their lead three minutes later when Mensing coolly slotted the ball past Langfield from the spot after Imrie had been upended by Stuart Duff.
Things went from bad to worse for Aberdeen when Richard Foster was shown a second yellow card for a late tackle on Marco Paixao with 20 minutes remaining.
And the Dons were reduced to nine men soon after when Diamond also received a second yellow for a crude lunge on the same player.
Young pulled a goal back for the Dons with five minutes remaining, but by that time the damage had already been done.