Yorkshire's fourth highest successful run chase was achieved with comfort, by six wickets with three overs of the allotted 70 remaining
Headingley (day four of four): Worcestershire 389 & 232-2d, Yorkshire 262 & 363-4 - Yorkshire won by six wickets
Shan Masood's brilliant 123 gave Yorkshire a happy ending to another difficult season as they chased a final day target of 360 to beat promoted Worcestershire at Headingley and avoid finishing bottom of the LV= Insurance County Championship for only the second time in their history.
Yorkshire's fourth highest successful run chase was achieved with comfort, by six wickets with three overs of the allotted 70 remaining.
With the game meandering ahead of day four, both sides opted to contrive a finish, with Yorkshire risking the draw which would lift them off the bottom of Division Two. As it was, they were able to achieve that by going for broke as captain Masood hit 15 fours in 131 balls.
Worcestershire advanced their second innings - they started it with a lead of 127 late on day three - from 18 for 2 to 262 for 2 declared inside the first 70 minutes of play. Jake Libby benefitted against declaration bowling with 109 not out, while Jack Haynes finished unbeaten on 113.
James Wharton was one of those bowlers, but he later helped Masood steer the run chase with three sixes in a fine career best 89. The third-wicket pair shared 164 either side of tea. Jonny Tattersall later hit the winning runs to finish 44 not out.
This was just a minor blot on Worcestershire's copybook having earned promotion on day two, and they should be applauded for their willingness to partake in invention.
Worcestershire secured promotion to Division One earlier in the match [Getty Images]
Yorkshire lost opener Finlay Bean sharply caught and bowled by Dillon Pennington for 11 just before lunch as the score slipped to 22 for 1 in the 10th over.
Pennington, playing his last game for the Pears before moving to Nottinghamshire, prevented 21-year-old Bean from reaching 1,000 Championship runs in an impressive breakthrough year. He fell only 17 runs short.
The consolation for the left-hander was that he was awarded the Yorkshire members' player of the year award at lunch.
Adam Lyth did, however, reach the milestone which Bean missed out on. He needed 32 at the start of this innings to reach 1,000 for the fourth time in his career. And his 51 off 62 balls gave Yorkshire a platform. He shared 88 either side of lunch with second-wicket partner Masood, only to fall caught at midwicket off a miscue against left-arm spinner Josh Baker - 110 for 2 in the 25th.
Captain Masood batted in dreamy fashion, driving and working particularly well in excellent batting conditions.
He reached his fifty off 57 balls before tea - Yorkshire were 175 for 2 after 39 overs, needing 185 more - and his second hundred for the county off 107 balls afterwards.
Yorkshire cruised through the final session.
At 237 for 2, they took the target to 123 from the final 20 overs. By that time, Wharton had reached his fifty off 71 balls.
Adam Lyth passed 100 runs [Stu Forster/Getty Images]
Baker bowled Wharton and had Masood caught at deep midwicket in quick succession, leaving the score 279 for 4 - 81 needed inside 14 overs.
But George Hill and Tattersall maintained the intent and shared an unbroken 84 for the fifth wicket. Hill contributed 38 of them, with both scoring at better than a run-a-ball.
This finish was engineered following an hour of forgettable cricket. Worcestershire resumed on 18 for 2, a lead of 145.
Yorkshire bowled properly for the opening 20 minutes through Matt Milnes and Ben Coad, but with no breakthrough they turned to declaration bowling from Bean and Wharton. They shared 19.1 overs, conceding more than 100 runs apiece.
Libby and Haynes, the latter in his final appearance for Worcestershire ahead of a move to Notts alongside Pennington, were the beneficiaries of an open goal chance to boost their averages.
They both reached centuries as a total of 214 runs were scored in 23.1 overs.
"People don't come to watch draws, so it's nice to set up a result," said Bean as he accepted his award at lunch.
For Yorkshire, things worked out well as they avoided a bottom-placed finished for the first time since 1983 and gave an early indication they will be promotion favourites next summer with no points penalty.