Queen of the South reached the quarter-finals of the Scottish Cup for the first time in 30 years after overcoming plucky Cowdenbeath.
The First Division side survived early pressure before Jamie Adams was brought down by Gary Fusco and Stephen Dobbie fired home from the penalty spot.
Second Division Cowdenbeath threatened to draw level several times.
But debutant Steve Tosh swept the ball over for Adams to make no mistake from six yards and send Queens through.
Queen of the South: MacDonald, Taton, McQuilken, Lauchlan, Jim Thomson, Scally, Adams, Tosh (Robertson 80), Gibson, Dobbie (Barrowman 67), O'Connor (Weir 84).
Subs Not Used: Corr, Henderson.
Goals: Dobbie 29 pen, Adams 54.
Cowdenbeath: Hay, Baxter (Patrick Scullion 32), Ellis, Hannah, Hill, Davidson (Dalziel 71), Docherty, Fusco, Ramsey (Fotheringham 60), Weir, Clarke.
Subs Not Used: Bryan, Allison.
Booked: Patrick Scullion.
Ref: K Clarke
Queen of South: MacDonald, Taton, McQuilken, Lauchlan, Jim Thomson, Scally, Adams, Tosh, Gibson, Dobbie, O'Connor. Subs: Corr, Weir, Barrowman, Robertson, Henderson.
Cowdenbeath: Hay, Baxter, Ellis, Hannah, Hill, Davidson, Docherty, Fusco, Ramsey, Weir, Clarke. Subs: Patrick Scullion, Fotheringham, Dalziel, Bryan, Allison.
Referee: K Clark