Well, it has been quite a day in the SPFL. Thanks to all the contributors around the grounds and to you for logging on to BBC Scotland's live football service. We'll leave you with this photo by SNS from K-Park which captures the commitment of the East Kilbride and Cowdenbeath players in the first leg of their League Two play-off final.
- Kilmarnock and Ross County now safe from relegation
- Motherwell leave Hamilton in relegation play-off spot; Caley four points adrift
- Dundee 1-1 Ross County (O'Dea; Boyce); Hamilton 0-1 Motherwell (Moult)
- Kilmarnock 2-1 ICT (Longstaff, Jones; Fisher); St Johnstone 1-0 Partick Thistle (Swanson)
- Rangers beat Hearts to seal third
- St Johnstone beat Partick to clinch fourth
- Raith relegated to League One after losing penalty shoot-out to Brechin
Interim Dundee boss Neil McCann took his unbeaten run to three - two wins and a draw - since taking over from the sacked Paul Hartley with a 1-1 draw against Ross County.
One more point may be enough, but a victory over Inverness on Wednesday would ensure their survival, and relegate Caley.
"It's a good point," he told BBC Radio Scotland. "We wanted three and want three on Wednesday. We're not there yet.
"We should've won it. For the first 20 minutes Ross County were in the ascendancy, they were the better side. We knew they would come at us. When things happen and you're tested, it shows a lot of character to come back from it.
"On the run they were on, maybe they wouldn't have come back from it. My goodness, I'm delighted with them because they did show character.
"After half an hour they started to trust their game. I felt we dominated towards the end of the first half and certainly for the next 45 minutes.
"You can see our game starting to develop. We are not a side that are prepared to be beaten."Copyright: SNS
Inverness CT manager Richie Foran: "I'm delighted with the players' performance, believe it or not. I told them they should be proud of themselves, how they handled the occasion. Individual mistakes have cost us again. The only disappointing part is the second goal. Jones has so much space to run at us. It's a set piece for us, they break and score - that's schoolboy defending but overall we were the far better team and had far better chances. We didn't get what we deserved and that was the three points, in my mind. We need to cut out the individual mistakes, it's been the story of the season. We've lost a lot of points with individual mistakes. We need a couple of results to go our way now so let's hope Ross County can do us a favour on Tuesday night (when they play 11th-placed Hamilton)."Copyright: SNS
As for who will be playing in League Two next season, Lowland League champions East Kilbride and Cowdenbeath are locked at 0-0 after the first leg of their play-off. Can Kilby reach Scottish football's fourth tier?
Alloa and Brechin will play over two legs for a place in the Championship. Both teams were in League One this season so it means promotion for one of them. Raith Rovers have been relegated.
Forfar and Peterhead will go head to head in the League One play-off final. Peterhead are trying to stay in the division whereas Forfar hope to be promoted from League Two after finishing runner-up to Arbroath.
Kilmarnock interim manager Lee McCulloch has succeeded in his mission to keep the Ayrshire club in the Premiership for another season, after their 2-1 win over Inverness at Rugby Park.
"The last 10 minutes were a bit nervy but we got there in the end," he told BBC Radio Scotland. "This is a young squad but they played tremendously well.
"We spoke at half-time about the final 15-20 minutes. We knew when we were under pressure they would be hitting it long, with the extra physicality in their team. We had to deal with that, and I thought we did it really well."
Pressed on whether he would now be made permanent manager at Rugby Park, McCulloch added: "It has got to be right for everybody involved - the club, the board, myself and the fans.
"Now we are safe, I imagine we will sit down and have a chat, but I don't know when that will be."
Andy Jackson sends the Raith Rovers keeper goalie the wrong way to win the shoot-out for Brechin City! Raith Rovers are relegated and Brechin will play Alloa for a place in the Championship next season. Incredible drama.
Scott Robertson shoots straight at the goalkeeper and Brechin have the advantage!
And he does. It's 3-3.
Declan McManus makes it 3-2 to Raith Rovers. Can Brechin respond with their fifth penalty? Ally Love has to score...
Alan Trouten scores for Brechin, it's now 2-2.
Bobby Barr's penalty is saved but Rovers still hold a 2-1 lead over Brechin in the shoot-out. Four missed penalties so far.
Raith Rovers hold a 2-1 advantage as Brechin miss another spot-kick.
Liam Watt misses his penalty for Brechin City and Raith Rovers lead 2-1 so far...
Alloa win the penalty shoot-out 4-3 against Airdrieonians! They will play Raith Rovers or Brechin City in the Championship play-off final.
Airdrieonians and Alloa are tied 3-3 on penalties so far...
Goodness me, it's penalties at Stark's Park too!
Hamilton boss Martin Canning is not a happy man after a third straight defeat leaves Accies in the relegation play-off spot, three points behind Motherwell with two games left.
"It's obviously not the result we were looking for. I thought we were the better team over the piece, and had a fantastic chance with Alex D'Acol.
"It was always going to swing on something minor. We have lost four goals from set-pieces since the split; make that five now.
"They got a a bit of luck with it hitting [Louis Moult's] shoulder and looping up over the keeper, but it is not luck that he found himself with a free header in our box.
"We are not a team that creates three, four, five, six chances in a game, and we were criminal defensively in terms of conceding from a set-piece.
"I said after the split we needed to win two out of five. It is out of our hands but now we need to win two out of two to give ourselves a chance."Copyright: SNS
Penalty kicks it is at Recreation Park!
Oh, wow! Liam Watt scores from 30 yards, only his second goal of the season, to level the match with six minutes of extra-time remaining. Unless there's another goal we are heading to penalty kicks!