McGrath gets Yorkshire over the line
Essex 177 and 28 for 2 need another 360 runs to beat Yorkshire 312 and 252 for 8 dec. (Rafiq 75*)
If this game does mark the end of Anthony McGrath's distinguished career at Yorkshire, he can depart in the knowledge that he played a full part in restoring a great club to a place in the top division of the County Championship. McGrath, who will be 37 and out of contract in a month, began his first-class career in 1995 and is one of just two men in this team who played in the Championship-winning side of 2001.
There have been a fair few downs to accompany the ups since then - McGrath has twice experienced relegation as well as those four Test and 14 ODI caps for England - but, if he has played his final first-class innings for the club he has served so well, he leaves with his head held high and knowing that he has helped Yorkshire return, in the words of their captain, "back where we belong".
When McGrath and Azeem Rafiq came to the wicket in the second innings, Yorkshire were in danger of allowing Essex back into this game. At 111 for 6, Yorkshire's lead was 246 and there was little batting left to come. Adam Lyth, who but for an awful 2011 would surely be streets ahead of Joe Root in the race for an England cap, was unfortunate to have been caught off the full face of the bat at short leg, while Gary Ballance had been brilliantly caught at point attempting to cut the impressively tight off-spin of Tom Westley.
But, instead of stumbling with the end in sight, the Yorkshire pair added 110 runs in 41.4 overs to take this game beyond Essex. Negating the increasingly sharp turn of Tom Craddock, who produced some diamonds amid the rust, the pace of Tymal Mills and the perseverance of Graham Napier, who strived in vain for a maiden 10-wicket haul, McGrath and Rafiq demonstrated composure, character and resilience to keep their side's hopes of winning the Division Two title alive.
We should not be surprised. McGrath also played a key role in the victory over Leicestershire - he scored 90 in Yorkshire's first innings and then took 4 for 21 in Leicestershire's first innings - and a key role in the victory over Gloucestershire - he finished unbeaten on 76 as Yorkshire chased 314 to win by two wickets. He still pulls with as much assurance as anyone in the county game and, when defending, there are still times when his bat looks as broad as a barn door. If he is not offered a new contract at Yorkshire, there will surely be a few other clubs interested.
Rafiq, meanwhile, seems to grow in stature by the day. Having underlined the impression he gave in the first innings - that he has a decent defensive technique and temperament - he also showed a welcome ability to change gear as Yorkshire accelerated towards promotion. He struck four of his last 11 deliveries to the boundary and finished unbeaten on 75. It is perhaps premature talk but he might just be Graeme Swann's spin-bowling successor in the England team.
The Yorkshire declaration left Essex needing 388 to win in a minimum of 107 overs. To put that in perspective, Essex have only scored that many runs in the fourth innings of a first-class game three times in their history and never at home. Bearing in mind the turning pitch and the somewhat uneven bounce, they are most unlikely to change that record on the final day. They lost Tom Westley, caught behind prodding at a good one that left him, and Jaik Mickleburgh, top-edging an ill-advised sweep to Rafiq's fourth delivery, before stumps.
Yorkshire are not guaranteed to top the division even if they win. If Derbyshire defeat Hampshire, the two top sides will be equal on points, but Derbyshire will prevail as they have won more games. The same logic would see Derbyshire prevail in the unlikely event that both sides draw.
In truth, Yorkshire would have secured promotion even without McGrath and Rafiq in this game. Kent's loss to Glamorgan allowed Derbyshire, the surprise package of 2012, and Yorkshire to go into the final day of their games knowing that promotion was secure. For a team that was third and trailing Derbyshire by 30 points with three games to go, it is a fine achievement.
Their captain, Andrew Gale, was understandably delighted. But, while saying his team can already compete with anyone, admitted they were in the market for a couple of new players before the start of next season. The fact that they will be playing Division One cricket will do no harm in convincing the likes of James Harris and Jack Brooks to come to Leeds.
"It feels like we're back where we belong," Gale said. "Last year hurt a lot. Yorkshire are a first division side and a massive club so we didn't want to play in Division Two. We knew we had the talent and the ability to get straight back up. We want to be competing with the best sides in the country and we've given ourselves the chance to do that. Given good weather we would have been up three weeks ago but those are the cards we've been dealt and now we're over the line.
"We had everything against us going into the last three games. We've won two out of three and we're in a great position in this one, obviously we want to go up as champions. We have a squad that can go far and compete seriously in Division One. We're one or two players light at the moment, but I hope we can fix that over the winter."
George Dobell is a senior correspondent at ESPNcricinfo