St Johnstone eventually reached the last eight of the Co-operative Insurance after overcoming a stubborn Queen of the South side.
The home side carved out a series of chances before Jody Morris's penalty broke the deadlock after Craig Reid was adjudged to have handled in the box.
Marcus Haber then slotted the ball past Queens goalkeeper Lee Robinson to double Saints' advantage.
Fellow substitute Chris Millar put the tie beyond doubt with a similar effort.
The first real chance fell to the home side from a Danny Grainger corner, but midfielder Murray Davidson was unable to keep his header on target.
Jennison Myrie-Williams and Collin Samuel then combined on the wing, but the former's cross ball was slightly in front of Samuel and the Trinidad international failed to connect.
Saints were creating more chances, although most of the match was being played in the midfield and the hosts went close again when a Maybury cross was dropped by Robinson only for Liam Craig to blaze his shot over the bar.
Former Saints midfielder Willie McLaren was providing some spark for the visitors and, after a mazy run which beat three Saints defenders, he fed veteran Allan Johnston, but the ex-Scotland man's shot was wide of Peter Enckelman's goal.
Samuel was profligate as Saints continued to dominate, heading just over from only six yards out from another Maybury cross.
The pattern of the game remained the same as the second half got underway with Robinson looking sharp to beat away a fierce effort from the lively Myrie-Williams.
Robinson then punched the ball off the line from Myrie-Williams's header as the home side turned the screw and looked to make their dominance count.
Sam Parkin headed inches wide following a cross from central defender Michael Duberry as Queens continued to defend stoutly.
However, the Perth men were handed a chance to finally get on the scoresheet when Reid was penalised for handball in the box.
Captain Morris converted the penalty low into the net to claim his first goal of the season and put Saints in front.
Saints keeper Enckelman then played the ball straight to the dangerous-looking McLaren, but the Queens winger could not capitalise on the Finn's mistake.
Substitute Haber put the tie beyond doubt, placing the ball past Robinson after being put through one-on-one with the Dumfries keeper.
Then Millar coolly slotted past Robinson after a great lay-off from Parkin.
McLaren thought he had netted a late consolation for Queens, but his fine effort was chalked off for offside.
A spirited performance by Queens but they were found wanting at times against Premier League opposition. They were unfortunate with the penalty incident which came just at the right time for Saints who were becoming increasingly frustrated.