Tranmere Rovers secured their League Two status for next season and ended Crewe Alexandra's play-off hopes with a 2-0 win at Prenton Park.
Tom Davies' first-half header and a late Kristian Dennis strike meant the hosts moved seven points clear of the relegation places with a game to play, extending the visitor's winless run to five matches.
Crewe finished the match with nine men as Tom Lowery and Zak Williams saw red, while Tranmere's Regan Hendry was also sent off in stoppage time.
The visitors started brightly and had a glorious opportunity to open the scoring after just two minutes when Connor Thomas' close-range effort was deflected wide.
At the other end, Alex goalkeeper Filip Marschall was called into action to deny Omari Patrick with a smart save.
But he was helpless in the 22nd minute when Rovers skipper Davies rose to meet Regan Hendry's free-kick and nod the ball into the far corner from six yards.
With the away side reduced to 10 men following the dismissal of Tom Lowery in the 69th minute, Tranmere went in search of a second.
And it was Dennis who secured the victory with three minutes remaining to ensure survival as the home fans took to the field to celebrate on the final whistle.
Match report supplied by PA Media.
Interim Tranmere boss Andy Crosby said:
"To collect the points we have over the past 12 games has been reward for really good preparation and performances, and when we've had setbacks we've bounced back immediately.
"I hope that the supporters celebrate tonight as it's been a tough ride for them this season, but we got there.
"But ultimately the football club has to grow and develop. We are celebrating being third bottom of League Two, which is a great achievement, but if you want to be a successful club you have to aim your sights higher than that."