Hull KR (18) 26 Tries: Dobson, Vella, Latus 2, Webster Dobson 3 Goals: Castleford (12) 24 Tries: Orr, Owen, Snitch, Thompson Goals: Orr 4
Latus's brace was the difference between the sides
Sam Latus scored two tries for Hull Kingston Rovers as they booked their Super League play-off place by edging an enthralling game against Castleford.
Danny Orr gave Cas the lead before Michael Dobson and retiring captain Michael Vella put the hosts in front.
Richard Owen scored for Tigers, Latus and Jake Webster then went over for KR either side of a Steve Snitch try.
Jordan Thompson then put Cas in front after Dobson missed his conversion before Latus secured a nervy win.
Victory for the Robins means Justin Morgan's stint in charge is not over just yet but the match proved to be Tigers coach Terry Matterson's farewell after six years in charge.
Castleford, who had 10 players missing, took the lead after Latus's first effort was ruled out by the video referee when he was held up.
The visitors seized their chance to take the lead when Adam Milner pounced on a Dobson error and put Orr away.
The try was converted by Orr but on 22 minutes Craig Hall charged down the left flank to feed inside to Dobson to score.
Dobson's 40-20 kick then led to Vella, making his last home appearance, crashing through to score a rare try. The goal made it 12-6 to Rovers.
Rangi Chase's reverse pass put full-back Richard Owen in, and Orr converted, to level the score.
Dobson added a penalty and Latus then got the try denied him earlier shortly before half-time.
Seven minutes after the break Owen's offload put Snitch over the line, Orr again on song with the extras, but then Webster won the foot race for Blake Green's kick to the corner for KR's fourth.
Arundel intercepted a Dobson pass to sprint 70m before being caught but the hosts could not stop Thompson going over in the corner.
Orr put Tigers infront with his touchline conversion.
The final twist came when Clint Newton and Shaun Briscoe combined to forge Latus's second of the night.
The Robins, who were only ahead of Cas in the table before the match by virtue of a better points difference, have now moved above city rivals Hull FC to finish in seventh place.
They will travel to the team that finishes sixth, either Leeds or Catalan Dragons, in week one of the play-offs next Sunday.
POST MATCH VIEWS
Hull Kingston Rovers coach Justin Morgan told BBC Radio Humberside:
"The TV cameras got their moneys-worth tonight I think, it was scratchy and nervous, as you'd expect.
"We didn't execute fantastically but we had some guts and determination and spirit.
"This club has soul and spirit and you can't buy that, you can't coach that, it comes from the current group of players and the club itself."
Hull KR: Briscoe, Latus, Welham, Webster, Hall, Green, Dobson,Vella, Hodgson, Taylor, Newton, Galea, Watts.
Replacements: Fisher, Murrell, Lovegrove, Cox.
Castleford: Owen, Arundel, Widders, Isa, Thompson, Chase, Orr, Fozzard, Milner, Massey, Jones, Holmes, Hudson.
Replacements: Snitch, J. Davies, Clark, Parker.
Referee: Richard Silverwood (Dewsbury).