Dundee 3-1 Forfar Athletic (aet)
Substitute Peter MacDonald scored twice in extra-time to secure Dundee's place in the Ramsdens Cup quarter-finals.
Stuart Malcolm headed home Iain Campbell's cross to give Forfar Athletic the lead at the start of the second half at Dens Park.
But Kevin McBride's shot evaded former Dundee goalkeeper Rab Douglas to level the match.
And MacDonald netted with strikes in the first and second periods of extra-time to ensure progress for the hosts.