Match ends, Hamilton Academical 1, St. Johnstone 1.
Hamilton Academical were left "aggrieved" and stuck on the bottom of the Scottish Premiership after Guy Melamed's late goal for St Johnstone denied them a priceless victory.
Ross Callachan's stunning first-half effort looked like lifting Brian Rice's side to 10th place and leaving their visitors' top-six hopes in tatters.
But Israeli striker Melamed struck for the dominant League Cup winners with three minutes remaining - a goal that Rice suspects was offside after seeing video replays.
"I've spoken to the linesman and he said he only had a split second," he said. "We all make mistakes, it might not be offside but I think it is. Once again I feel a little bit aggrieved."
Hamilton remain bottom of the division on goal difference, with a game in hand over Kilmarnock.
St Johnstone, meanwhile, are eighth - five points adrift of sixth-placed St Mirren with two games before the split.
Fresh from their Hampden victory over Livingston on Sunday, St Johnstone dominated the first half and spurned a number of opportunities to take the lead.
Scott Tanser had the best of the openings, his first time volley direct from a corner just flashing wide.
The away side continued to push Hamilton back, with Melamed having three attempts well-saved by Hamilton goalkeeper Ryan Fulton.
The Israeli forward was involved in a lot of St Johnstone's good first-half play, but he and his team-mates lacked the quality of finish required.
And Callum Davidson's side were made to pay for that when Hamilton went ahead. Callachan's effort was right out of the top drawer, his curling effort flashing into the net after Bruce Anderson did well to hold off defenders.
St Johnstone continued to have most of the play in the second half but couldn't find their cutting edge. Their best chance again fell to Melamed, only for Fulton to dive to his right and brilliantly keep out the striker's close-range header.
It began to feel as though it would be a typical late season Accies win as St Johnstone lost their man-of-the-moment Shaun Rooney to injury at the beginning of the second half.
That sense was heightened as Rice's side showed a greater threat on the break, Callachan stealing the ball from Craig Bryson before laying off to David Moyo, whose thunderous shot crashed off the bar.
It would prove costly as absent defending allowed an unmarked Melamed to collect a long ball from Liam Gordon before finishing smartly with the outside of his right foot.
Man of the match - Ross Callachan
What did we learn?
This was a heartbreaking defeat for Hamilton but a win may have been a fortuitous one as they defended deep for most of the match. They still hold the cards with a game in hand on their nearest rivals but to not see that victory out could prove crucial.
St Johnstone will be pleased in the main with their performance as they were clearly the better side. But for a dearth of quality finishing they could have been comfortable winners. Top six looks like it might be just out of reach but that might allow them to focus on the possibility of a cup double.
What they said
Hamilton head coach Brian Rice: "I'm disappointed to lose the late goal I thought we had defended ever so well. We got near the finishing line but couldn't quite get over it."
"We are confident [we can survive], we've been over the course before, we know what's required. I see a team out there giving everything. It's going to be nip and tuck from now to the end of the season."
St Johnstone manager Callum Davidson: "Overall it wasn't too bad, first half we were better. When you go one nil down you have to chase the game with discipline I thought we became a little bit ragged trying to force the game and force passes rather than doing what we're good at.
"We play first on Saturday so we can try to give ourselves the best chance [of top six], hopefully we can try to get the result which will give us that chance."
Hamilton travel to Pittodrie to face Aberdeen on Saturday (15:00 GMT), while St Johnstone are at home to Hibernian the same day (15:00 GMT).
- 34CallachanBooked at 90mins
- 14TraffordSubstituted forStirlingat 85'minutes
- 8MartinSubstituted forHughesat 82'minutes
- 7AndersonBooked at 69mins
- 4McCartBooked at 69mins
- 19RooneySubstituted forBrownat 50'minutes
- 13BrysonSubstituted forO'Halloranat 66'minutes
- 26CraigBooked at 76mins
- 10WotherspoonBooked at 75mins
- 14MaySubstituted forMiddletonat 66'minutes
- Grant Irvine
- Shots on Target
Second Half ends, Hamilton Academical 1, St. Johnstone 1.
Attempt saved. Hakeem Odoffin (Hamilton Academical) header from the centre of the box is saved in the centre of the goal. Assisted by David Moyo with a headed pass.
Corner, Hamilton Academical. Conceded by David Wotherspoon.
Foul by Guy Melamed (St. Johnstone).
Brian Easton (Hamilton Academical) wins a free kick in the defensive half.
Attempt blocked. Guy Melamed (St. Johnstone) right footed shot from the centre of the box is blocked. Assisted by Glenn Middleton.
Ross Callachan (Hamilton Academical) is shown the yellow card.
Liam Gordon (St. Johnstone) wins a free kick in the defensive half.
Foul by Ronan Hughes (Hamilton Academical).
Attempt missed. Liam Gordon (St. Johnstone) header from the left side of the box is high and wide to the left. Assisted by Liam Craig with a cross following a set piece situation.
Jason Kerr (St. Johnstone) wins a free kick in the attacking half.
Foul by Hakeem Odoffin (Hamilton Academical).
Goal! Hamilton Academical 1, St. Johnstone 1. Guy Melamed (St. Johnstone) right footed shot from the centre of the box to the centre of the goal. Assisted by Liam Gordon.
Corner, St. Johnstone. Conceded by Hakeem Odoffin.
Attempt blocked. David Wotherspoon (St. Johnstone) right footed shot from outside the box is blocked. Assisted by Michael O'Halloran.
Substitution, Hamilton Academical. Ben Stirling replaces Charlie Trafford.
Attempt missed. Liam Craig (St. Johnstone) left footed shot from outside the box is too high.
Substitution, Hamilton Academical. Ronan Hughes replaces Scott Martin because of an injury.
Guy Melamed (St. Johnstone) wins a free kick in the defensive half.