GLAMORGAN pulled off one of the most remarkable victories in County Championship history to boost their chances of promotion out of Division Two.
A Glamorgan win had looked very unlikely following the first two and half days of this intriguing contest against Essex, but resilience and a never-say-die attitude got Robert Croft's side through to their fifth success of the campaign to put some clear water between them and their promotion rivals.
The result was a cricket world record. Never before has a side scored 642 in a first innings and then gone on to lose the game.
Glamorgan were indebted to Croft, who had been largely responsible for guiding his side past the follow-on target on Saturday, and a well-paced 83 not out from David Hemp which bagged 21 important points.
It was a memorable day for Hemp. He registered his 10th score of more than 50 this summer, but also passed 1,000 first class runs for the season.
Having been left 221 from 69 overs for victory after they bowled Essex out for 165, Glamorgan wrapped up the match with 22 balls to spare.
Glamorgan have not lost a championship match at Chelmsford in 33 years.
The manner of Glamorgan's victory, considering that they had been 305 away from the follow-on on Saturday with only five wickets standing, brought back memories of two other games that enjoyed dramatic turnaround in fortunes.
First the clash at the Rose Bowl last year where Glamorgan made Hampshire follow-on, only to lose the game, and the game in 1993 at Sophia Gardens when Glamorgan amassed 563 in their first innings before going down by 10 wickets.
Glamorgan's win yesterday was by four wickets, but up until the final 40 minutes all four results had still been possible.
There were moments when an Essex win had looked likely. One of those instances was on the stroke of tea when Glamorgan lost Matthew Maynard.
And then when Danish Kaneria came on for his third spell and removed Jonathan Hughes and Darren Thomas in the space of three balls there must have been a few jitters on the visitors' balcony.
But Hemp and Croft adopted cool heads taking Glamorgan from 153-6 to the winning post, putting on 70 in 15 overs.
The magnitude of the victory was summed up as Croft and Hemp had a mid-pitch hug for a job well done.
At the beginning of day four, with Essex 155 runs ahead, Glamorgan knew if they could engineer an early breakthrough they would have a great chance of keeping their victory target down to manageable proportions.
But the start to the final day was beyond even their wildest hopes as Essex's last six second innings wickets fell for 59 runs.
Croft was the main architect of Essex's dramatic demise, taking four for 13 in 44 balls.
Two Jonathan Hughes assists saw the removal of first innings centurions James Foster and Andy Flower, before Simon Jones got the deserved wicket of Graham Napier caught behind.
Andre Adams committed suicide by hitting Croft down long on's throat before Ashley Cowan played down the wrong line to give the Glamorgan skipper his 49th victim of the summer.
But the ground fielding was shabby, a display that saw them drop three catches - two by Darren Thomas, to give James Middlebrook two extra lives.
It meant that instead of Essex being 139 all out, and leave Glamorgan needing 195, Middlebrook was able to farm the bowling in a 27-run partnership with Danish Kaneria. But in the final analysis it was all in vain.
Meanwhile, Maynard is doubtful for Glamorgan Dragons final match of their title-winning totesport League campaign against Essex at Chelmsford tonight, a day-night match starting at 4.10.
Essex: (from) W Jefferson, R Irani, A Flower (capt), P Grayson, R Bopara, Middlebrook, Foster, Napier, A Adams, A Cowan, D Kaneria, A Palladino.
Glamorgan: (from) R Croft (capt), I Thomas, M Powell, M Maynard, D Hemp, R Grant, R Watkins, M Wallace, D Harrison, A Davies, M Lewis, S Jones, D Cherry.