Hull KR gained a timely boost ahead of the National League One play-offs when they became only the second team to defeat promotion favourites Salford.
The Reds were already assured of top spot, but the gloss was taken off their final match of the regular season as they fell to an 18-16 defeat.
Hull, who finished in fourth place, needed a try-saving tackle from full-back Lynton Stott in the dying seconds to clinch a memorable win.
Tries from Wes Davies and Cliff Beverley helped Salford to a 12-0 lead but Hull KR responded with scores of their own through Andy Ellis and Ally McClarron.
Early in the second half, Paul Mansson went over for another Hull try to put the home side ahead for the first time.
Simon Baldwin brought the visitors level when he touched down in the corner but when Gavin Clinch missed the conversion he gave Stott the chance to land a crucial penalty.
Stott then ankle-tapped Reds winger Andy Kirk to seal a dramatic victory.
Hull KR will be at home to Oldham, who secured a play-off spot with a 19-14 win at Featherstone.
Oldham trailed 14-12 with only seven minutes left when Australian Dane Morgan crashed over for the winning try which Gavin Barber converted.
Featherstone, the only other team to beat Salford this season, missed out on the play-offs after Whitehaven claimed a 68-12 win over Dewsbury.
Rugby league legend Alex Murphy watched with satisfaction as his new club Leigh ran in 12 tries in a 68-16 win over Rochdale to secure second place.
Rochdale face a sudden-death tie against Whitehaven at Spotland.
In National League Two, Chorley won 38-12 at bottom club London Skolars but had to settle for second place on points difference.
They will visit Sheffield in the first round of the play-offs.
Winger Eric Andrews maintained his remarkable scoring rate, touching down for the 15th successive match to take his tally for the season to 22.
Keighley came from behind to beat Gateshead 21-16 and deny Paul Fletcher a win in his last match as coach.
The Cougars will be at home to Hunslet in next Sunday's eliminator while Barrow earned a trip to York thanks to a 38-34 win at Swinton.