Experienced striker Derek Lyle came off the bench to score the only goal of the game as Queen of the South beat Championship rivals Hamilton 1-0 in the Scottish Cup.
The best chance of the opening exchanges fell to Hamilton's Jon McShane, who headed Alister Crawford's cross just wide of the far post.
The visitors went close again on the stroke of half-time. Crawford's dipping volley beat Zander Clark but rebounded off the crossbar.
Queens took the lead against the run of play after 64 minutes when Lyle turned home Chris Mitchell's corner from three yards.
Championship leaders Hamilton pressed for an equaliser but Queens held on to book their place in the fourth round.