A brace from defender Mark McLaughlin secured Hamilton a 2-1 win at Ayr.
Midfielder Micheal McGowan had given the home side the perfect start to the new season, driving home from inside the box to put them in front after just eight minutes.
But McLaughlin ensured the two teams went in at the break level, meeting Douglas Imrie's inswinging corner to head home after 28 minutes.
McLaughlin then struck once more just before the hour mark, again profiting from an inswinging Imrie corner to head the ball past a helpless Kevin Cuthbert.
The home side pressed for the remainder of the half and almost grabbed an equaliser with 15 minutes to go but substitute Gareth Wardlaw's header was tipped over by Hamilton goalkeeper Tomas Cerny.