Saints made one change to the team that had started the last five games, with Steven Thomson handed his debut in place of Garry Brady.
The visitors took the lead midway through the first half when Hamilton scored from the spot after Andy Dorman had been fouled. However, Neil Janczyk levelled things up less than a minute into the second half, sparking fears of another game at Love Street - or another cup embarrassment.
Fortunately, Saints went back in front after a defensive mix-up allowed Hamilton to set up Dennis Wyness to score, and with 20 minutes to go Hamilton finished things off when he took advantage of what seems to have been a comical moment to score Saints third.
The performance doesn't seem to have been anything special, but the important thing was to end our cup jinx against SFL sides and ensure we didn't have to go to Love Street again.
We now face a trip to either Inverurie Locos or Motherwell in the next round, with the two sides meeting tomorrow.