Match ends, Morton 0, St Johnstone 1.
A controversial late goal by Gary McDonald secured St Johnstone a place in the Scottish League Cup semi-finals at the expense of Greenock Morton.
The match appeared to be heading for extra-time when Saints won a free-kick.
Stevie May's shot was blocked but referee John McKendrick ordered the set-piece to be retaken, much to Morton's frustration.
The second effort was spilled by goalkeeper Nicolas Caraux and McDonald netted from the resulting loose ball.
St Johnstone join Aberdeen, Hearts and Inverness Caledonian Thistle in Thursday's semi-final draw.
Scottish Championship side Morton were hoping to claim another Premiership scalp after their shock win at Celtic Park in the previous round.
And the hosts's captain Mark McLaughlin had an early header saved by goalkeeper Alan Mannus.
A speculative long-range effort from Dougie Imrie flew wide of the visitors's goal and the midfielder tested Mannus with another drive moments later.
Nigel Hasselbaink fired into the side netting as Saints tried to force an opener before the break.
With chances few and far between in the second half, St Johnstone won a free-kick 25 yards out that David Wotherspoon fired against the outside of the post.
Brian Easton then directed a Wotherspoon corner over Caraux's goal.
As the match entered injury-time, Saints won another free-kick and May's effort came back off Nacho Novo, only for referee McKendrick to order the retake.
Novo was booked for encroachment and May's second effort was not held by Caraux, allowing McDonald to pounce and secure victory for the Perth side.
St Johnstone boss Tommy Wright: "We had the character to keep going but you also have to give Morton credit. We showed hunger and desire to get a winner. When Stevie May is over a free-kick then anything can happen. It's come off the keeper and we've followed it in - Gary McDonald's stuck it in.
"We're happy to come through the tie and have a big game to look forward to. To get a goal that late, maybe fortune's favouring us."
- 3FitzpatrickSubstituted forPageat 36'minutes
- 18HabaiBooked at 28mins
- 20Gómez NovoBooked at 90mins
- 7McKeeBooked at 48minsSubstituted forStirlingat 58'minutes
- 8ImrieBooked at 90mins
- 24EastonBooked at 40mins
- 5WrightSubstituted forScobbieat 46'minutes
- 4CreggSubstituted forDavidsonat 64'minutes
- 11HasselbainkBooked at 25minsSubstituted forFallonat 79'minutes
- John McKendrick
- Shots on Target
Second Half ends, Morton 0, St Johnstone 1.
Dougie Imrie (Morton) is shown the yellow card.
Goal! Morton 0, St Johnstone 1. Gary McDonald (St Johnstone) right footed shot from the right side of the six yard box to the bottom right corner.
Attempt saved. Steve May (St Johnstone) right footed shot from outside the box is saved in the top right corner.
Nacho Novo (Morton) is shown the yellow card.
Hand ball by Nacho Novo (Morton).
Attempt blocked. Steve May (St Johnstone) right footed shot from outside the box is blocked.
Steve May (St Johnstone) wins a free kick in the defensive half.
Foul by Michal Habai (Morton).
Attempt saved. Steve May (St Johnstone) right footed shot from the left side of the box is saved in the top centre of the goal.
Foul by Steve May (St Johnstone).
Jonathan Page (Morton) wins a free kick on the left wing.
Attempt saved. Chris Millar (St Johnstone) right footed shot from the right side of the box is saved in the top centre of the goal.
Attempt missed. Nacho Novo (Morton) right footed shot from outside the box misses to the right.
Attempt blocked. Nacho Novo (Morton) right footed shot from the left side of the box is blocked.
Foul by Steve May (St Johnstone).
Stephen Stirling (Morton) wins a free kick in the defensive half.
Foul by Dougie Imrie (Morton).
David Mackay (St Johnstone) wins a free kick in the defensive half.