Rotherham ended their six-season stay in npower League Two and condemned Aldershot to non-league football next season with their 2-0 win at New York Stadium.
Johnny Mullins broke the deadlock from close range in the 64th minute before Lee Frecklington scored Rotherham's second in injury time to seal promotion to the third tier.
Defeat for Aldershot meant they were unable to bridge the gap to safety and drop out of the Football League along with Barnet, who were beaten 2-0 by Northampton. Goals by Roy O'Donovan and Luke Guttridge for the Cobblers doomed Barnet, who were relegated thanks to their poorer goal difference than Dagenham and Redbridge, who also finished the season with 51 points.
York, who had for some time to be staring into the abyss, ended their campaign on a high with a 1-0 away win over Dagenham and Redbridge, Chris Smith scoring the only goal.
AFC Wimbledon, who had been in the drop zone at the start of the day, escaped following their 2-1 win over Fleetwood, while Torquay were another side in danger of relegation but Aldershot and Barnet's defeats and their 3-3 draw against Bristol Rovers saw them to safety.
Elsewhere, Cheltenham drew 0-0 against 10-man Bradford, who lost Andrew Davies midway through the second half, while Lee Hughes' goal for Port Vale cancelled out Dean Morgan's penalty for Wycombe as they drew 1-1 to their automatic promotion.
Chesterfield finished just outside of the play-off places despite their 4-0 win over Exeter. Goals by James O'Shea and Marc Richards, plus a brace for Jack Lester in the final game of his career saw Chesterfield finish on a high and end up two points adrift of Bradford in the last play-off place.
Play-off-bound Burton beat champions Gillingham 3-2 at the Pirelli Stadium.
Morecambe beat Southend 1-0 thanks to Andrew Fleming's first-half goal and Rochdale beat 10-man Plymouth 1-0, with Joe Bunney's header midway through the second half the difference after Maxime Blanchard saw red in the 15th minute.
Oxford beat Accrington 3-0 with Accrington midfielder Lee Molyneux shown a red card one minute before the final whistle. James Constable, Deane Smalley (penalty) and Sean Rigg scored the goals for Oxford.