Patrick Thistle 1-3 Rangers (after extra-time)
Extra-time strikes from Daniel Candeias and Eduardo Herrera fired Rangers into the Betfred Cup semi-finals as they battled to a 3-1 win over Partick Thistle.
Carlos Pena marked his first Gers start by heading home the opener at the Energy Check Stadium.
Kris Doolan's last-gasp leveller, though, was the last thing Ibrox boss Pedro Caixinha needed with Saturday's Old Firm showdown looming.
But Candeias and substitute Herrera relieved the pressure on the under-fire Portuguese coach with their strikes to book Gers' place in tomorrow's semi-final draw.
Pena has been made to wait three-and-a-half months to break into Caixinha's starting XI.
The £2.5million recruit from Guadalajara has struggled to justify his costly price tag so far, with fitness issues and troubles adapting to life in Scotland blamed for his slow start at Ibrox.
But there were early signs his sharpness was returning as he headed down for Candeias to fire over, while he also slipped in Alfredo Morelos later on only for the little Columbian to be denied by Danny Devine's desperate lunge.
There were, though, also moments where he looked rusty. For example after 36 minutes, his attempt to dummy the ball for Josh Windass proved ill-advised as Thistle snatched possession.
It took the reflexes of keeper Jak Alnwick to save his blushes after Blair Spittal sent Conor Sammon sprinting in behind the Light Blues defence.
Alnwick produced an even better stop to deny Sammon again after the Irishman got his head to Edwards' knock down from Christie Elliott's cross.
Morelos' finishing let him down eight minutes into the second period as he pushed wide after Candeias robbed Devine.
However, Pena finally made his mark after 55 minutes as he beat Devine and Paul McGinn to Candeias' corner, flicking his header past Ryan Scully into the far corner.
Alnwick frustrated Sammon for a third time with another impressive stop but Candeias was guilty of an horrendous miss as he robbed McGinn, rounded Scully but blazed over with the goal gaping.
That proved costly as Doolan sent the tie into extra time with his last-minute leveller.
Adam Barton sent a deep cross to the back post, Sammon headed down and the Jags poacher did the rest from close range.
But Candeias made amends four minutes after the restart as collected Herrera's tee-up before lashing an unstoppable drive low past Scully.
Herrera then made sure of Gers' place in the semis on the 99th minute as he cleverly flicked home from a Candeias centre.
PARTICK: Scully, Keown, Devine, Turnbull (Doolan 57), McGinn, Barton, Edwards, Elliott, Spittal (Nisbet 83), Lawless (Bannigan 105), Sammon. Subs not used: Nitriansky, Sneddon, McCarthy.
RANGERS: Alnwick, Tavernier, Cardoso, Bruno Alves (McCrorie 76), John (Hodson 79), Candeias, Jack, Dorrans, Windass, Pena (Holt 71), Morelos (Herrera 90).
Subs not used: Foderingham, Dálcio, Nemane. Man of the match: Pena
Referee: Steven McLean
Match rating: 6/10