Nicky Clark's added-time goal averted a Scottish Cup shock for Dundee United at home to League 1 Partick Thistle.
The Scottish Premiership side had to fight back after going behind following a dominant first-half from Thistle that included Scott Tiffoney heading them in front.
Thistle had other chances to increase the lead, but two defensive errors from Mouhamed Niang was their undoing.
Lawrence Shankland equalised before Clark knocked in a last-gasp winner.
Micky Mellon's side will find out their fourth-round opponents in Sunday's draw.
Dundee United manager Micky Mellon: "We played at a good tempo but just needed a bit more quality. But we showed the resilience you need to win a cup tie."
Partick Thistle manager Ian McCall: "At half-time we should have been leading two, three, maybe even four goals. And we felt we had a really good shout for a penalty, it looked like stonewall.
"At half-time we were a bit gutted because it was only 1-0 because it should have been over."