Aberdeen edged past lower league Dumbarton 1-0 courtesy of a late penalty to reach the Scottish Cup fifth round.
The Dons dominated possession at Pittidrie but were flat and insipid in the final third against the League One under-dogs.
An unwelcome replay was looming until a penalty was awarded in the 85th minute for a foul by Rico Quitongo on Sam Cosgrove.
Leading scorer Cosgrove converted the spot kick for his 21st goal of the season and to fire Aberdeen into the next round.
The draw for the fifth round will be made on Sunday evening.
Aberdeen made five changes to the side that were held 1-1 by Hearts in the final game before the Premiership winter shut-down.
There was a debut for January transfer window signing Dylan McGeouch who arrived on a permanent deal from Sunderland.
Leading scorer Sam Cosgrove returned having served a two-game suspension and Andy Considine was also back from injury.
Also returning to the starting line-up were Connor McLennan and Niall McGinn.
Dropping out were injured Zak Vyner, who is sidelined with a dislocated shoulder suffered against Hearts.
Midfielder Lewis Ferguson was suspended and Dean Campbell, Jon Gallagher and Curtis Main all dropped to the bench.
The opening opportunity fell to new signing McGeouch who fired in an effort from just inside the box but it was straight at keeper Conor Brennan who comfortably saved.
Moments later Niall McGiinn delivered a corner kick from the left deep into the penalty area that found Ash Taylor, but the centre-back’s flicked header from 12 yards flew over the bar.
Aberdeen should have gone ahead in the 27th minute when a blocked Cosgrove shot broke to the unmarked Bruce Anderson in the box, but he snapped at his shot and his left-footed effort flew over the bar.
On the half-hour mark Andy Considine headed over when connecting with a McGinn corner.
Soon after McGinn curled a long-range effort over goal. Aberdeen were enjoying plenty of possession but were showing little cutting edge in attack.
On the stroke of half-time Anderson was played in on goal but hesitated in offloading his shot.
By the time he did shoot it was too late and deflected wide for a corner.
From the resultant corner Considine headed straight at the keeper from eight yards.
It was the last action of a flat, uninspiring first half from Aberdeen against the part-timers.
The Dons began the second half positively with McGinn shooting across the face of goal and wide in the 47th minute.
In the 53rd minute McGinn picked out Cosgrove breaking into the penalty area but the striker headed over from 12 yards out.
Moments later Scott McKenna headed over from a McGinn corner as Aberdeen’s frustrations in front of goal continued.
In the 63rd minute McGinn flashed a cross along the face of goal to find Anderson but he fired over on the run from 12 yards.
Aberdeen were denied in the 73rd minute when Anderson fired in a powerful drive from 15 yards but keeper Brennan did well to save.
In the 80th minute McGinn opened up space for himself but curled his effort wide of goal.
Aberdeen were awarded a penalty in the 85th minute when Cosgrove was brought down in the box by Quitongo, who was booked.
The leading scorer sent the keeper the wrong way to send the Dons through.
ABERDEEN: Lewis, Logan, Taylor, McKenna, Considine, Ojo, McGeouch, McGinn, McLennan, Anderson, Cosgrove.
Subs: Hedges (for McLennan 67), Campbell (for McGeouch 78), Gallagher (for Anderson 90)
Subs not used: Cerny, Devlin, Wilson, Main.
DUMBARTON: Brennan, Crawford, Quitongo, Langan, Neill, Hutton, McCluskey, McKee, Wilson, McGreever, Crossan.
Subs: Zata (for Wilson 75),
Subs not used: Pettigrew, Tierney, Scullion.