Yorkshire hit back strongly after Derbyshire opener Chesney Hughes amassed 270 not out on the second day at Headingley.
The 22-year-old Anguilla-born left-hander guided Derbyshire to 475 all out and was only five runs short of his county's highest individual score, set in 1896 by George Davidson, when last man Tim Groenewald was out for a duck.
Joe Root (75no) and Phil Jaques (15no) were at the crease for Yorkshire at stumps, who reached 164-1 in reply, still 311 behind, after Adam Lyth's earlier knock of 69.
Hughes struck 40 fours and three sixes in his mammoth innings which lasted nine hours and eight minutes, the highest against Yorkshire at Headingley.
The opening batsman was on 171 when Derbyshire resumed in the morning on 302-4 and he soon settled down after a couple of early edges had evaded the slips on their way to the third-man boundary.
Dan Redfern, however, fell before a run had been added after he hit out wildly at the fiery Tim Bresnan to be caught by Adam Lyth at second slip. The England paceman was in good form and could have picked up more wickets if fortune had been on his side.
Partnered by former Yorkshire all-rounder, David Wainwright, Hughes' first landmark of the day was to complete his double century off 328 balls with 30 fours and three sixes.
Wainwright departed lbw sweeping at Rashid to end an 81-run stand for the sixth wicket and Steven Patterson gained a similar verdict against Jon Clare, Derbyshire going in to lunch on 416-7 with Hughes on 240.
Despite showing signs of stiffness in the later stages of his epic knock, Hughes still managed to maintain exemplary discipline at the crease and he put on 53 with Tom Poynton as he sailed past the 250 mark.
Poynton had his off-stump ripped from the ground by Liam Plunkett and Tony Palladino was bowled by Jack Brooks to bring in last man Groenewald but he lasted only five deliveries, denying Hughes the likelihood of walking off with Derbyshire's highest ever score.
Adam Lyth outscored opening partner Root as 53 were added in 13 overs up to tea and after the break both moved smoothly to their half-centuries, Lyth off 68 balls with nine fours and Root from 77 deliveries with seven boundaries.
Lyth added a couple more fours in his innings of 69 before he drove casually at Groenewald and was caught at second slip by Redfern.