Dundee United suffered late heartbreak at Rugby Park as Kilmarnock scored an injury-time winner.
With almost the last kick of the ball, Sammy Clingan blasted a freekick past toiling Tangerines keeper Rado Cierzniak.
This performance was yet another that saw the Tannadice team look both great going forward and vulnerable at the back.
Losing centre-half Callum Morris at half-time to injury didn’t help, neither did some poor goalkeeping from Cierzniak.United were on the front foot from kick-off and took a dramatic lead with just two and a half minutes on the clock.
They were gifted a penalty when Killie’s Alexei Eremenko clattered into Rankin inside the box – right in front of referee Stephen Finnie.
There was no doubt it was a spotkick and up stepped Nadir Ciftci to shoot low to goalkeeper Craig Samson’s right to make it 1-0 to United.
The Tannadice team’s bright start nearly earned a second goal when Ryan Dow was sent clear but Samson did well to come off his line and make the save.
However, it was 1-1 on 10 minutes when the Tangerines conceded a terrible goal.
A high ball into the box appeared harmless enough until it was hooked back across the face of goal by Josh Magennis. Cierzniak was too easily beaten as the ball trundled past him and inside the post.
The game was wide open and, just three minutes later, United snatched the lead back.
Once again it was a case of a keeper not covering himself in glory as Samson seemed to help Henri Anier’s shot into the net after the Estonian international was played in by Chris Erskine. It was Anier’s first goal for his new club.
On 25 minutes, United defender Morris headed over from close range then the same man went on a mazy run that was only halted after he raced into the box.
There was an incredible escape for the home team on 31 minutes when a looping cross from the left by Paul Dixon was booted off the line but only as far as Dow. He had a go but his shot was blocked and then the same happened to Anier before the ball was finally cleared.
United were passing it about nicely and looked like scoring every time they moved upfield.
However, Killie gave them a scare of 40 minutes when a Magennis header almost sneaked inside the far post.
United had to rejig things at half-time when Morris went off injured to be replaced by Euan Spark.
Manager Jackie McNamara moved Ryan McGowan into the heart of the defence alongside Sean Dillon, with Spark slotting in at right-back.
With Jarek Fojut sitting in the stand serving a suspension, the Tangerines were now without their first-choice central defensive pairing.
Killie quickly tried to capitalise on any uncertainty in the visitors’ ranks and Cierzniak did well to get down to save a header from Magennis three minutes into the second period.
However, it was 2-2 on 52 minutes when United conceded yet another terrible goal.
There seemed to be more meat in a half-time pie than the shot from Chris Johnston but, despite the Killie man slipping as he struck the ball, it still somehow managed to squeeze its way past Cierzniak and his defenders.
On 57 minutes, the visitors brought on Blair Spittal for Erskine then they had a lucky escape when Tope Obadeyi missed from right in front of goal.
Former Killie frontman Robbie Muirhead made his debut for the Tangerines on 73 minutes when he replaced Anier and was greeted by a mixture of boos and applause from the home fans.
There was to be no fairytale win for Muirhead against the club he left on transfer deadline day.
Instead, it turned into a horror story as United lost the game in the third minute of injury-time.
Rankin conceded a freekick just outside the box and up stepped Clingan to bullet his shot past Cierniak to grab Killie’s first win since January 1 and inflict United’s first defeat of 2015.
Attendance: 3,788.
Kilmarnock: Samson, Connolly, Clingan, Johnston (Cairney 86), Obadeyi, Slater (Hammill 73), Eremenko (Eccleston 86), Chantler, Magennis, Pascali, Westlake. Subs not used: Brennan, Barbour, O’Hara, Syme.
Dundee United: Cierzniak, McGowan, Morris (Spark 46), Dillon, Dixon, Rankin, Telfer, Erskine (Spittal 57), Ciftci, Dow, Anier (Muirhead 73). Subs not used: Szromnik, Paton, Butcher, Connolly.
Referee: Stephen Finnie.