A strike by Darian Mackinnon after 16 minutes turned out to be the difference between the teams.
Accies were rewarded for a bright start when Mickael Antoine Curier slipped a superb reverse pass to Mackinnon inside the penalty area, and although Alan Mannus got a hand to the ball he could not prevent the goal.
Hamilton almost doubled the lead with a half-volley from Ali Crawford, but Mannus got across to stop the ball hitting the top corner of the net with a wonderful save.
Stephen Hendrie did beat Mannus with a low drive across the face of goal after he burst into the box on an overlap, but he was denied a goal as Steven Anderson got back to hook off the line.
Saints could have been back on level terms a minute after the restart when the ball dropped to Lee Croft after Michael McGovern misjudged a delivery into the box, but the winger was forced wide and his cross was cleared by Hendrie.
And the home side survived another scare when Anderson saw his effort crash off the Hamilton crossbar.
But Accies could have added to their lead as well and Martin Canning’s header was cleared off the line by Steven MacLean from a Crawford corner.
Hamilton have responded well to their opening day defeat to Inverness by taking six points from matches against St Mirren and St Johnstone.