Rangers survived a scare to fight back for a victory which bizarrely keeps both teams' European hopes alive.
Marvin Andrews was the unlikely hero for Rangers as Kris Boyd marked his return to Rugby Park with a trademark goal.
Alan Combe had to be at his brilliant best to keep Rangers out in 15th minute. He smartly parried Thomas Buffel's snap-shot but the ball broke to Gavin Rae, who drilled the ball towards the opposite post. Combe somehow recovered to make the ground up and push the ball to safety.
Rangers' makeshift defensive pairing of Julien Rodriguez and Ian Murray always looked rocky and the pair were liable when Kilmarnock took the lead in the 28th minute. Lindsay Wilson floated the ball in from the right and Gary Wales had the space to knock the ball down to Colin Nish, who whacked home the volley.
Killie then lost skipper Gary Hay to a nasty head knock after a collision with former team mate Boyd, and Rodriguez passed up the chance to equalise during the defence's re-organisation when he tamely headed over.
Thomas Buffel teed Boyd up two yards out in first-half injury time, but the former Kilmarnock striker was unusually slow to react.
The Rangers players and fans were howling for a penalty in the final minute of the half when Chris Burke was hauled down by Wilson, but Calum Murray ludicrously gave a free-kick outside the area.
Alex McLeish made a change at half-time, replacing the hapless Alan Hutton with Marvin Andrews, and the big defender made his mark five minutes later. Steven Smith floated a free-kick to the far post where Andrews simply glanced his header into the bottom corner.
The equaliser settled Rangers' nerves and Boyd got his goal in the 64th minute after Dado Prso had spun away from his marker and crossed for the striker to nip in front of Gordon Greer to nod home.
Rangers' control grew and Andrews scored his second in the 81st minute after Chris Burke had beaten the offside trap and chipped across for the defender to nod home from point-blank range.
He could have scored an unprecedented hat-trick a minute later but couldn't direct his header on target from four yards.