Ian Cockbain’s first County Championship century since 2014 and 97 from Tom Lace saw Gloucestershire chase 348 to beat Leicestershire by four wickets at Bristol.

Cockbain and Lace arrived just after lunch at 52 for three when winning the game was fanciful but they played calmly through to tea to leave 216 to win from 37 overs of the final session.

Their intent was immediate and they extended their stand to 224. Lace couldn’t see the chase through and Cockbain fell for 117 so it was left to George Hankins to strike the winnings runs.

It was the fourth-highest Championship run chase in Gloucestershire’s history, a third victory to take them top of Group 2 and a remarkable turnaround having conceded a first-innings lead of 146.

Leicestershire were denied 22 overs on the third evening through bad light and rain and it denied them the chance to totally close the door on their hosts while giving them enough time to bowl them out again.

The Foxes left themselves 82 overs in the fourth innings and when the top three all fell cheaply, a first win of the season was possible.

But Lace and Cockbain batted through the afternoon to raise prospects of saving the game before having a dip in the final session.

Cockbain flicked Alex Evans to fine leg for four, pulled him over square leg for six and then pulled Wright for four to raise a first first-class half-century since April 2016 - this being just his fifth game since then.

He skipped at Callum Parkinson’s left-arm spin to lift him over deep midwicket for six and flat-batted Chris Wright over long-off for another maximum to bring the target down to 100 from 17 overs before pulling Wright for two to raise his century in 166 balls with nine fours and three sixes.

He finally fell skying a catch to mid-off but by then the game was effectively won.

Lace initially led the resistance after lunch. He straight-drove Wright for four to go to a second fifty of the season and was on the cusp of a maiden century for Gloucestershire before top-edging a pull from Parkinson to midwicket.

Leicestershire rather stumbled over their morning’s work in being bowled out for 201 and, without the injured Dieter Klein, were powerless to stop the Glosters’ evening charge.

Gloucestershire’s Ian Cockbain, said: “It was a pretty special day today.

“We got off to a slow start but then Tom and I built a solid stand going into tea and we had a platform to go and win the game.

“We still had wickets in the shed so we both thought we’d start giving it a go and got off to a flier and put ourselves in a good position to get home.

“It’s obviously very nice to be back in the mix and back playing red-ball cricket again."