A wonder strike from Gary Harkins earned Dundee a Scottish Cup win against a battling Livingston side.
In a game littered with chances, Third Division Livi pushed the big-spending First Division leaders all the way. But Harkins set up a fifth round home tie with Ayr United by smashing a shot from 25 yards into the top corner. Soon after the 33rd-minute goal, Dundee keeper Derek Soutar kept his side in front by pushing away a poor penalty kick from Liam Fox.
The match was twice postponed but it was worth the wait for the 1,176 crowd who braved the cold West Lothian night.
The first clear-cut chance of the game fell to Fox, but Soutar made the first of several good saves to repel the midfielder's header. Dundee's response was immediate as a quick breakaway ended with former Livi ace Leigh Griffiths forcing Roddy McKenzie into a fine save.
Soutar made another stop to deny veteran forward Robbie Winters just before the visitors took the lead through Harkins' screamer.
Livi were handed a golden chance to level when Winters was tugged down by Chris Casement, but Fox failed to convert from 12 yards.
Early in the second half McKenzie had to be at his best to keep out a 20-yarder from former team mate Leigh Griffiths. And Soutar made a wonderful double save to deny Keaghan Jacobs as play raged from end-to-end.
Despite not being at their best, Dundee kept threatening, with Harkins, Pat Clarke and Griffiths all spurning opportunities to extend their side's lead. Fox attempted to atone for his missed spot-kick in the 71st minute, but his 20-yarder was kept out by Soutar.
Livi had one final chance late on, but Jonathan Brown headed over from Raffaele De Vita's corner.
McKenzie, Brown, Talbot, Watson, MacDonald, Hamill, Fox (Kyle Jacobs 81), Keaghan Jacobs, Halliday, Winters, De Vita (Sinclair 89)
Subs not used: McDowall, Griffin, McNulty
Soutar, Benedictus, Lauchlan, Forsyth, Casement (Paton 46), Malone, Harkins, Kerr, Young (Klimpl 83), Griffiths (McMenamin 90), Clarke
Subs not used: Bullock, Hart
Referee: W Collum