Although the hosts started strongly on Sunday, Hamilton improved as the match went on and dominated for large spells to move third in the Scottish Premiership table and four points behind leaders Aberdeen.
It was Saints who conjured up the first real effort on goal with Michael O’Halloran lashing a close range effort against the bar following a scramble in the Hamilton box.
And they went close again when James McFadden – who was later sent off – took the ball past a couple of visiting defenders before curling it narrowly wide from the edge of the box.
Yet it was Accies who broke the deadlock in the 34th minute when an unmarked Tony Andreu found the bottom right-hand corner of the net after volleying home Stephen Hendrie’s cross from 10 yards.
And four minutes later Hamilton almost added a second with Mickael Antoine-Curier firing narrowly wide after collecting Ali Crawford’s pass.
With Hamilton controlling the latter stages of the first half, Crawford blasted a free-kick wide of the left post with 45 minutes on the clock.
Early in the second half it was Hamilton’s turn to strike woodwork, with Antoine-Curier’s deflected effort smacking the bar following good work by Dougie Imrie.
But after being outplayed for most of the previous 30 minutes, Saints finally found their stride again with Frazer Wright heading over from the edge of the six yard box on the hour mark as he met McFadden’s corner.
O’Halloran also had efforts to snatch an equaliser only to be denied by visiting keeper Michael McGovern on more than one occasion.
However, eight minutes from time, St Johnstone were reduced to 10 men when McFadden collected his second yellow card of the game for a foul on Eamonn Brophy and Hamilton held on to collect three more points on the road.