Jack Leach returned career-best figures of 8-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/4 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 leaving Essex with just three points.

Essex started the day on 147/1, 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.

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

Dan Lawrence batted well 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/4 at the interval, with ten Doeschate unbeaten on 31. He was joined by Ravi Bopara, who had been unwell, and they frustrated the home attack, adding 31.

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 before Somerset made the breakthrough.

Bopara could barely believe it when bowled for 27 by Leach off an inside edge, and 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 and his one-man show ended when Jamie Porter departed lbw pushing forward, sparking wild celebrations among the Somerset fielders at winning a game they seemed to have let slip the previous evening.