Yorkshire sealed promotion back to Division One of the County Championship after dominating day three against Northamptonshire.
Promotion rivals Middlesex were bowled out for 271 by Sussex, which left Yorkshire needing 350 in their first innings to secure second place in the table.
Adam Lyth (147) and James Wharton (162 not out) hit centuries as Yorkshire got the three batting bonus points they required and reached the close on 371-2.
Yorkshire were relegated to Division Two by one point in 2022, and then docked 48 points last season for their handling of the Azeem Rafiq racism scandal.
The Tykes will swap places with Roses rivals Lancashire after their relegation was confirmed with another poor batting display at Worcestershire.
Northants resumed on 117-6 at a sunny Headingley but lost their last four wickets quickly as seamer Ben Coad claimed 4-51 and Matt Fisher took three wickets.
George Bartlett was the only visiting batter to show any resistance with an unbeaten 64.
Yorkshire lost Fin Bean cheaply, but dominated with the bat from then on.
Lyth and Wharton put on 260 for the second wicket at around five runs an over before Lyth was pinned lbw by spinner Fateh Singh.
With light fading, Wharton put his foot on the accelerator to try and take Yorkshire past 350 and they got there just before 18:00 BST.
The hosts will now try and wrap up victory on the final day with a lead already standing at 224.