Hamilton moved three points clear of the drop zone in the Scottish First Division with a 2-1 victory over fellow strugglers Cowdenbeath at New Douglas Park.
The visitors took a first-half lead through Kane Hemmings but the Accies hit back with two quickfire goals after the break from Jonathan Page and Stevie May.
The hosts then survived the final 22 minutes with only 10 men after Alex Neil was sent off in the 68th minute.
Hemmings put the visitors ahead in the 24th minute with a well-taken goal although Hamilton almost levelled immediately when Ali Crawford ploughed through the Cowdenbeath defence and the ball broke to Louis Longridge who fired just wide.
Page levelled in the 61st minute after some fine play by sub Grant Gillespie and May then put Hamilton ahead with a 22-yard screamer just four minutes later.
Neil then saw red for a second bookable offence but the home defence held firm for a crucial three points, while Cowdenbeath are now without a win in 15 league matches.