Yorkshire were bowled out for 86 as Nottinghamshire completed a remarkable turnaround to claim a 58-run victory on the third evening at Headingley.
Nottinghamshire had resumed at the start of the day on 175-6 in their second innings, still needing 18 just to make the Tykes bat again.
Chris Read (86) and Steven Mullaney (83) batted throughout the morning session during a seventh-wicket partnership of 150.
Adil Rashid (3-52) finally made the breakthrough in the afternoon by trapping Read lbw, one of three quick wickets for the leg-spinner as Nottinghamshire were all out for 337.
Faced with a victory target of 145, Yorkshire promptly collapsed to 15-3 as Charlie Shreck struck twice and Luke Fletcher once in the first five overs.
And, despite a defiant half-century from Jonathan Bairstow, wickets continued to tumble with Joe Root (14) the only other bastman to make double figures.
Yorkshire were all out for 86 in 30.3 overs, seam trio Shreck (3-29), Fletcher (3-27) and Paul Franks (3-24) each finishing with three wickets.
Bairstow finished on 50 not out from 77 balls, including nine boundaries.
Nottinghamshire face an uphill battle to avoid a heavy defeat at Headingley after Andrew Gale led from the front for Yorkshire on day two.
Tykes skipper Gale hit an unbeaten 145, including dominating a 10th-wicket stand of 82 with Oliver Hannon-Dalby, to help his side make 336 all out in their first innings - giving them a massive lead of 193.
The left-hander plundered 15 fours and two sixes to rescue his side after they had slipped from 213-5 overnight to 254-9 in the morning session.
Needing to bat much better second time around, Nottinghamshire suffered a disastrous start when they lost their first three wickets with jusy 38 on the scoreboard.
Alex Hales - who top-scored with 83 on day one for the visitors - looked to have steadied the ship with 85, as he put on a 103-run partnership with Australian Adam Voges (42).
However Richard Pyrah removed both set batsmen as he and Ryan Sidebottom shared six wickets to leave Notts reeling at 175-6, still 18 behind.
Yorkshire's Ryan Sidebottom took 4-30 against his former county and Richard Pyrah a career-best 5-58, as champions Nottinghamshire were skittled out for just 143 at Headingley.
Having elected to bat, the visitors were taken by surprise by the amount of swing Sidebottom obtained in a lethal new-ball spell which brought him three wickets for 15 runs in nine overs, five of which were maidens.
Pyrah came on first change and claimed a wicket with his first ball thanks to a stunning catch by Adam Lyth at first slip. He went on to better his career best figures for the second time in a week.
Notts would have been in even deeper trouble but for some splendid batting from Alex Hales, who welcomed the introduction of spin by driving David Wainwright for six and bringing up his 50 in the same over with his seventh four.
Hales was eventually caught on the mid-wicket boundary by Gerard Brophy for 85 from 89 balls, with 10 fours and two sixes.
Yorkshire themselves were in something of a hole at 144-5 after Luke Fletcher claimed 3-55, but captain Andrew Gale (47 not out) and Adil Rashid (39no) retrieved the situation admirably by adding an unbroken 70, as they reached the close in a strong position on 213-5.