Goals from Nikolaj Moller and Panutche Camara sealed Dundee United's spot in the last 16 of the Scottish Cup at Ayr United's expense.
The Swedish striker - introduced as a second-half substitute - turned in Ryan Strain's cross for the game's opening goal before fellow substitute Camara fired home a second in injury time against the Championship visitors.
On a patchy pitch, quality was in short supply, but United had the better of the second half and deserved their victory.
Playing down the slope in the first half, the hosts lacked any real cutting edge.
Ross Graham hooked a shot onto the roof of the Ayr goal, Zac Sapsford was denied by visiting goalkeeper Liam Russell, while Luca Stephenson whipped a shot just wide from the edge of the box.
Ayr's best effort came from striker Anton Dowds, but Dave Richards got down sharply to his left and turned the goal-bound shot round a post.
However, the top-flight outfit improved after the break as Craig Sibbald became increasingly influential.
Amar Fatah tested Russell and Moller put a free header wide as the pressure on Ayr began to build.
And the former Arsenal man made no mistake shortly after when he was picked out by Strain, deflecting the cross from the right beyond Russell.
With time running out, Camara made sure of victory, running onto Kristijan Trapanovski's pass and opening up his body to fire into the back of the net.