A MARATHON batting performance from Ian Cockbain rescued a miraculous draw for Gloucestershire from their County Championship game against Surrey at Bristol.

Making his first County Championship appearance of the season due to injuries to Chris Dent and Will Tavare, Cockbain hit a career-best 151 not out from an eight-hour, 45-minute stay at the crease to lead Gloucestershire to safety at 506-6 in their second innings after the visitors dominated the first two days and built a first innings lead of 514.

The key to Gloucestershire’s successful survival mission was a 177-run sixth wicket stand between Cockbain and Tom Smith, who also recorded a highest first-class score of 80 to justify his promotion in the batting order with his only previous half-century being the 50 he scored against Leicestershire in September 2013.

Michael Klinger (120) led Gloucestershire’s resistance by hitting a century for the second consecutive County Championship game and sharing a 101-run stand with Cockbain on the third day.

Gloucestershire resumed the final day still needing 240 runs just to make Surrey bat again with only five wickets left but on a flat pitch Cockbain and Smith were relatively comfortable in the morning session as they both passed 50 and brought up a century partnership.

Cockbain was stuck on 48 for the first half-hour before reaching his half-century from 189 balls and he survived a strong lbw appeal from Jade Dernbach on 56 but grew in confidence as the session went on, aided by some positive strokeplay from Smith.

By comparison, Cockbain took just 67 more balls to bring up just his third first class century with a paddle for two off Dernbach 20 minutes after lunch but the third new ball did the trick for Surrey, Smith edging a Matt Dunn delivery to Rory Burns at third slip with the score on 434.

Fears of a batting collapse never materialised as Will Gidman (46*) added an unbroken partnership of 72 with Cockbain before the teams shook hands at 5.25pm.

Gloucestershire were shot out for just 112 in their first innings as Dunn (4-37) and Chris Tremlett (2-24) ripped through the top and middle order, Geraint Jones top-scoring with 28.

Surrey surpassed that score easily without losing a wicket as Burns, who finished one run short of a double ton, put on 215 with opening partner Zafar Ansiri (98).

Burns also shared a 200-plus third wicket stand with Vikram Solanki, who piled on the misery by hitting 143, and Jason Roy smashed an unbeaten 121 off 71 balls against a weary bowling attack before Surrey declared on 626-6 at the end of the second day.