Rotherham United earned a 2-0 win over Aldershot Town to secure their promotion to League One on Saturday.
United left it late to pick up the three points, as Lee Frecklington scored the winner in the fourth minute of stoppage time to ensure his side finished second in the table.
Rotherham will be joined in League One next season by already-crowned champions Gillingham, and Port Vale, who drew 1-1 away to Wycombe Wanderers to take third.
Dean Morgan opened the scoring for Wycombe, but Lee Hughes earned Port Vale a point 11 minutes from time.
At the bottom of the league, Northampton Town consigned Barnet to relegation by beating them 2-0 at home and, although Dagenham & Redbridge lost 1-0 to York City, they escaped the drop by virtue of goal difference.
Northampton’s goals came in the second half as Roy O’Donovan and Luke Guttridge sealed Barnet’s fate, with York, Accrington Stanley and Plymouth Argyle all staying up.
Plymouth suffered their 20th defeat of the season as Rochdale edged them 1-0, while AFC Wimbledon who confirmed their survival with a 2-1 win over Fleetwood Town.
Elsewhere, Bradford City grabbed the final play-off place thanks to a 0-0 draw with Cheltenham Town, where they will be joined by Burton Albion, who beat Gillingham 3-2.
Morecambe finished the season victorious after beating Southend United 1-0 away and Exeter City suffered a heavy 4-0 defeat on the road at Chesterfield in two mid-table clashes.
Accrington Stanley stayed clear of the bottom two despite losing 3-0 to visitors Oxford United, while Torquay United played out an enthralling 3-3 draw with Bristol Rovers.