Stevie May returned to haunt former club Hamilton as he bagged a double to send St Johnstone into the quarter- finals of the League Cup.
May, who spent last season on loan with Accies, grabbed the opener early on in the tie at New Douglas Park.
Gwion Edwards then came off the bench to claim his first goal for the club late on, before May struck again in injury-time.
May was drafted back into the Saints side after coming off the bench as they suffered defeat to Celtic at the weekend.
Hamilton added Tony Andreu and Jon McShane to their own starting line-up as they aimed to add cup success to an impressive start to their league campaign.
But the Scottish Championship leaders were unable to claim a top-flight scalp despite a decent display on the night.
The home side were left reeling when they found themselves trailing with just four minutes on the clock.
Dave Mackay's ball into the box was nodded back across goal by Steve MacLean for May to head home from close range.
Accies could have been back on level terms but were denied by the woodwork when Andreu's effort crashed off the post.
At the other end, Saints were threatening again when Chris Millar squared across the face of goal for MacLean but his shot was touched over by Kevin Cuthbert.
Millar then turned provider for May and his effort was deflected wide for a corner that the visitors failed to capitalise on.
With half-time approaching, Andreu tried his luck with a drive that fizzed just past the upright as Saints headed into the interval with their narrow advantage intact.
The Perth side looked determined to add to their lead after the restart and Nigel Hasselbaink powered his way into the box only for his shot to be blocked by Cuthbert.
Saints continued to struggle to break down the stubborn resistance of the home side, with Accies still in with a chance of salvaging the tie as the match entered the final 15 minutes.
A long free-kick punted into the box was met by the head of Mikey Devlin but he could not keep the effort down.
With Saints beginning to look nervous, Andreu then whipped a tempting ball into the goalmouth but, this time, Devlin sliced wide of target.
But there was no way back for Accies when substitute Edwards picked up the loose ball from a slack back-pass and bundled home from close range to secure the win for the visitors with four minutes to go.
May then put the gloss on the win with a superb 25 yard strike deep into injury-time.
Why are you making commenting on The Herald only available to subscribers?
It should have been a safe space for informed debate, somewhere for readers to discuss issues around the biggest stories of the day, but all too often the below the line comments on most websites have become bogged down by off-topic discussions and abuse.
heraldscotland.com is tackling this problem by allowing only subscribers to comment.
We are doing this to improve the experience for our loyal readers and we believe it will reduce the ability of trolls and troublemakers, who occasionally find their way onto our site, to abuse our journalists and readers. We also hope it will help the comments section fulfil its promise as a part of Scotland's conversation with itself.
We are lucky at The Herald. We are read by an informed, educated readership who can add their knowledge and insights to our stories.
That is invaluable.
We are making the subscriber-only change to support our valued readers, who tell us they don't want the site cluttered up with irrelevant comments, untruths and abuse.
In the past, the journalist’s job was to collect and distribute information to the audience. Technology means that readers can shape a discussion. We look forward to hearing from you on heraldscotland.com
Comments & Moderation
Readers’ comments: You are personally liable for the content of any comments you upload to this website, so please act responsibly. We do not pre-moderate or monitor readers’ comments appearing on our websites, but we do post-moderate in response to complaints we receive or otherwise when a potential problem comes to our attention. You can make a complaint by using the ‘report this post’ link . We may then apply our discretion under the user terms to amend or delete comments.
Post moderation is undertaken full-time 9am-6pm on weekdays, and on a part-time basis outwith those hours.
Read the rules hereComments are closed on this article