Jack Leach returned career-best figures of eight for 85 as Somerset maintained their challenge for a first ever County Championship title with a 45-run win over Essex at Taunton.

Chasing a daunting 336 to win, Essex looked well placed at 256 for four, with Nick Browne having contributed 86 and Tom Westley 56. But then captain Ryan ten Doeschate fell to Leach for 50 and the match swung Somerset’s way.

Essex started the day on 147 for one, needing a further 189. Browne and Westley began cautiously and had added 24 without alarm when Browne top-edged an attempting sweep off Leach to be caught by Jamie Overton running from slip to leg-slip.

Overton then pinned Westley, who had reached a 117-ball half-century, leg-before to give Somerset a further boost with the score still on 171.

Dan Lawrence batted sensibly with ten Doeschate, but fell on the stroke of lunch for 21 to a fine arm-ball from Leach, which skidded through his defence and bowled him.

It was 225 for four at the interval, with ten Doeschate unbeaten on 31. He was joined by Ravi Bopara, who had been unwell, and together they frustrated the home attack, adding 31 meticulously.

The Essex captain was then beaten and bowled by a sharply turning ball from Leach shortly after reaching an impressive 72-ball half-century, with 8 fours.

The visitors still required 80 and it was compelling cricket as Bopara fought to keep his side’s hopes alive. Adam Wheater fell caught and bowled by Leach off a leading edge before Somerset made the key breakthrough.

Bopara could barely believe it when bowled by Leach off an inside edge, stepping back to cut a short ball. He had made a valiant 27, but the target was still 55 runs away.

It looked out of reach when Simon Harmer fell to Dom Bess. So it proved as Peter Siddle was well caught by Overton at slip attempting to slog Leach over the short leg-side boundary on the town side the 49 still required.

Leach’s one-man show ended when Jamie Porter departed lbw pushing forward, sparking wild celebrations among the Somerset fielders.