Match ends, Kilmarnock 2, Rangers 1.
Kilmarnock 2-1 Rangers: Steve Clarke's side finish third to qualify for Europe
Steve Clarke's Kilmarnock clinched third place in the Scottish Premiership for the first time since 1966 - and a Europa League place - after a late penalty winner against Rangers.
The hosts shrugged off speculation that Clarke will be named Scotland boss this week to edge out Aberdeen.
Veteran former Rangers winger Chris Burke's early strike was cancelled out by Alfredo Morelos' thundering finish.
But Eamonn Brophy's late penalty sealed the victory Kilmarnock needed.
The goal kept them ahead of Aberdeen - who won at Hibernian - on goal difference and secured a return to European football for the first time since 2001 and a record points total.
They also ended the Steven Gerrard side's run of seven consecutive victories as Kilmarnock finished their season with a flourish thanks to three straight wins of their own.
- Clarke 'sorry for not winning trophy'
- Gerrard hints at Rangers deal for Stewart
- Reaction & as it happened
Resilience, record scorer and hero's reception
If the Scottish FA does persuade Clarke to leave, he will do so with the club and the team transformed in his 19 months in charge of the team he supported as a boy.
Kilmarnock had halved Rangers' normal allocation of tickets, yet 12,248 - the best at Rugby Park this season - turned up in the hope of a crucial result and perhaps say goodbye to their manager.
Yet Rangers, despite Gerrard making five changes, started the game with the swagger you would expect from a side fresh from a derby victory over champions Celtic.
Morelos, back up front despite Jermain Defoe's fine form, had already scored nine times in six meetings with Kilmarnock this season and was only to be denied by a fine block from Jamie MacDonald, before Daniel Candeias fired against the crossbar.
Resilience has been the watchword for Kilmarnock under Clarke and they survived that early pressure to take the lead when on-loan Celtic midfielder Youssouf Mulumbu pounced on Glen Kamara's loss of possession and found Burke with a clever chip before the winger to slotted low past Wes Foderingham.
Rangers were almost back level straight from the restart as MacDonald, restored in place of on-loan Watford goalkeeper Daniel Bachmann, beat away a Ryan Kent shot then Morelos fired wastefully into the side netting.
Morelos was to play a crucial double role in his 30th goal of the season - his 18th in the Premiership edging out Aberdeen's Sam Cosgrove to finish as the division's top scorer.
Moments after Aberdeen had edged into the lead at Easter Road, the striker crashed into MacDonald and minutes later sent a drive flashing past the ailing goalkeeper, who was soon to be replaced with debutant Devlin MacKay.
When Liam Millar had a goal disallowed for offside, it looked like it was not going to be Kilmarnock's day. But Stephen O'Donnell went down after a tug on his shirt by Borna Barisic and Brophy's spot kick evaded the fingers of goalkeeper Andy Firth, who had replaced the injured Foderingham.
The scene was set for manager of the year Clarke, who had been sitting in the stand because of a Scottish FA touchline ban, to come down to join in the justifiably wild celebrations, address the crowd but leave the question unanswered about whether it was a last triumphant bow as Kilmarnock manager.
'These boys will be here next season' - reaction
Kilmarnock assistant manager Alex Dyer: "We couldn't worry about what Aberdeen and Hibs were doing and the boys have pulled it out again. We came here to do a good job and it has worked well.
"We have a good squad, a hard-working squad. They took on board what we said and it worked out well. Those boys will be here next season and the club have a good base again."
Rangers manager Steven Gerrard: "I'm disappointed with the outcome of the game. I don't think Kilmarnock's general play deserved to beat us - I think we have beaten ourselves.
"I thought we were better in the second half until we scored, and then we stopped playing. The referee has then given Kilmarnock a soft penalty to give them the day they wanted."
- 1MacDonaldSubstituted forMackayat 68'minutes
- 2O'DonnellBooked at 76mins
- 24MulumbuSubstituted forMcAlenyat 80'minutes
- 29BurkeSubstituted forMillarat 80'minutes
- 13FoderinghamSubstituted forFirthat 83'minutes
- 15FlanaganBooked at 21mins
- 31BarisicBooked at 88mins
- 16HallidaySubstituted forDefoeat 80'minutes
- 21CandeiasSubstituted forAwokoya-Mebudeat 63'minutes
- 20MorelosBooked at 68mins
- William Collum
- Shots on Target
Second Half ends, Kilmarnock 2, Rangers 1.
Foul by Conor McAleny (Kilmarnock).
Ryan Kent (Rangers) wins a free kick in the attacking half.
Liam Millar (Kilmarnock) wins a free kick on the right wing.
Foul by Ryan Kent (Rangers).
Goal! Kilmarnock 2, Rangers 1. Eamonn Brophy (Kilmarnock) converts the penalty with a right footed shot to the bottom left corner.
Borna Barisic (Rangers) is shown the yellow card for a bad foul.
Penalty Kilmarnock. Stephen O'Donnell draws a foul in the penalty area.
Penalty conceded by Borna Barisic (Rangers) after a foul in the penalty area.
Stuart Findlay (Kilmarnock) wins a free kick in the defensive half.
Foul by Ryan Jack (Rangers).
Corner, Rangers. Conceded by Stuart Findlay.
Corner, Kilmarnock. Conceded by Joe Worrall.
Attempt blocked. Liam Millar (Kilmarnock) right footed shot from the centre of the box is blocked.
Corner, Rangers. Conceded by Greg Taylor.
Attempt missed. Conor McAleny (Kilmarnock) header from the centre of the box is close, but misses to the left.
Substitution, Rangers. Andy Firth replaces Wes Foderingham because of an injury.
Substitution, Rangers. Jermain Defoe replaces Andy Halliday.
Substitution, Kilmarnock. Conor McAleny replaces Youssouf Mulumbu.
Substitution, Kilmarnock. Liam Millar replaces Chris Burke.
Corner, Kilmarnock. Conceded by Connor Goldson.
Attempt missed. Ryan Kent (Rangers) right footed shot from outside the box is too high from a direct free kick.
Stephen O'Donnell (Kilmarnock) is shown the yellow card for a bad foul.
Foul by Stephen O'Donnell (Kilmarnock).
Ryan Kent (Rangers) wins a free kick in the defensive half.
Stuart Findlay (Kilmarnock) wins a free kick in the attacking half.
Foul by Alfredo Morelos (Rangers).
Attempt saved. Greg Taylor (Kilmarnock) left footed shot from the left side of the box is saved in the top centre of the goal.
Rory McKenzie (Kilmarnock) wins a free kick on the right wing.
Foul by Jon Flanagan (Rangers).
Substitution, Kilmarnock. Devlin Mackay replaces Jamie MacDonald because of an injury.
Alfredo Morelos (Rangers) is shown the yellow card for excessive celebration.
Goal! Kilmarnock 1, Rangers 1. Alfredo Morelos (Rangers) left footed shot from the centre of the box to the top left corner. Assisted by Ryan Jack.
Corner, Rangers. Conceded by Greg Taylor.
Substitution, Rangers. Adepapo Awokoya-Mebude replaces Daniel Candeias.
Attempt missed. Alan Power (Kilmarnock) left footed shot from the left side of the box is close, but misses the top left corner.
Foul by Kirk Broadfoot (Kilmarnock).
Jon Flanagan (Rangers) wins a free kick in the attacking half.
Youssouf Mulumbu (Kilmarnock) wins a free kick in the defensive half.