Substitute Gary Wales filled the departed Kris Boyd's boots with an injury-time winner to stun Dundee United.
The Terrors looked the side likely to snatch a winner after dominating the second half, but Wales' winner piled even more pressure on Gordon Chisholm.
The visitors enjoyed the bulk of possession in the early stages, but Kilmarnock had a greater cutting edge and looked likelier to score.
Colin Nish had the first clear chance in the fourth minute when a simple ball over the top beat the defence, but the beanpole striker scuffed an ugly shot wide of the post.
Steven Naismith latched on to another straight ball five minutes later, but United goalkeeper Derek Stillie rushed out to block at his feet.
The teenager then wasted the best chance of the opening spell after a great passing move. After patient play around the United box, Stevie Murray nodded the ball to Gary MacDonald who slid a perfect pass to Naismith five yards out, but he spooned his shot high.
Kilmarnock took a deserved lead in the 38th minute thanks to a freak goal. MacDonald worked himself into a good crossing position on the byline, and when his delivery came in, it somehow found its way behind Stillie and into the goal at the far post.
United were far more effective in the second half and drew level in the 51st minute when Alan Combe spilled Barry Robson's header and Collin Samuel smashed the rebound high into the net.
The visitors pushed forward but despite forcing numerous corners, they failed to find a second goal.
And they paid the price in the dying seconds when Wales swept the ball home after Danny Invincibile nodded the ball into his path.