An injury-time goal from Scott Vernon made it back-to-back wins for Aberdeen under new manager Craig Brown.
Dons keeper Jamie Langfield produced a splendid save to keep out a fizzing 30-yard free-kick from Dougie Imrie in the first half.
But there was little else in the way of goalmouth action until Vernon's dramatic late strike.
The forward finished from close range to leave Hamilton grounded at the foot of the Scottish Premier League.
The Accies have now scored just one goal in their last six outings and lie five points adrift of Hibernian, who play later today.