Somerset's Matt Renshaw and Sean Dickson tamed a seaming pitch to lay the foundations for a three-wicket Vitality County Championship First Division win over Essex in two days at Taunton.
Thirty wickets had fallen in the match when the visitors were bowled out for 138 in their second innings. There were three each for Somerset seamers, Josh Davey and Lewis Gregory, while Jordan Cox top-scored with 27 on a still-green wicket.
A target of 167 for victory looked daunting for the home batting line-up given what had gone before. But Renshaw (35) and Dickson (42) put on an opening partnership of 75 and, although Essex's bowlers went about their business with aplomb, Somerset always looked the favourites from then on.
Andy Umeed's 34 and Tom Banton's 29 took them over the line for 19, leaving Essex all out for three.
Somerset's seamers were soon among the wickets as their opponents began the day on six for no loss in their second innings. Dean Elgar edged a catch to wicketkeeper James Rew off Davey with the score on 11 for one and, with four runs on the board, Sam Cook was caught by Umeed at third slip off Craig Overton, with Dickson at fourth slip scooping the ball up to his team-mate with one hand.
It was 37 for three when Tom Westley fell lbw to Davey pushing forward before Nick Browne and Jordan Cox added 30 for the second wicket. Browne, on 23, then got an inside edge off his pad to send a Gregory delivery looping up for a catch at third slip.
At lunch, Essex were 95 for four with a lead of 123. The fifth wicket fell for 106 when Matt Critchley flicked a delivery from Davey to Rew, who took a low diving catch at slip.
Overton picked up the pace and forced Cox to edge to the second slip where Tom Lammonby took a routine catch. Thain and Harry Duke took the score to 137 before Essex's final four wickets fell in quick succession, Duke feathering a defensive shot off Jake Ball to Rew and Thain trapped lbw by Gregory.
Simon Harmer was trapped leg before by the ball and when Rew took another low diving catch to send last man Jamie Porter back for a duck, it meant a third wicket for Gregory.
Soon openers Renshaw and Dickson set a positive target of 167 against Cook and Porter in bright sunshine. Both went for their shots and by tea they had taken the score to 45 not out from 11 overs, leaving Somerset needing just 122 runs to win.
Dickson took the stand past 50 with a glorious off-drive for four off Shane Snater, followed by a six over long-on in the same over. Renshaw followed with a blistering square drive for four off Cook.
When Renshaw edged to Snater, the ball fell agonisingly short of the slip cordon. Cook gave Essex some hope when he had Renshaw lbw with the total on 75, but by then only 92 were required.
Dickson followed in the next over, caught behind after hitting his third four, and suddenly Somerset had two new batsmen at the crease. But Umeed continued to pile the pressure on the Essex bowlers, hitting two consecutive fours in one over from Cook.
Lammonby matched his first innings patience but, having faced 23 balls without scoring, he padded to a Snater delivery that nipped in off the seam and fell lbw with 68 needed.
Umeed had faced 55 balls, hitting 5 fours, when he edged a Snater delivery that cannoned off wicketkeeper Duke and looped to Harmer at second slip. With 47 to win, Somerset needed to keep their heads.
Michael Pretorius failed to do so, lofting a catch to extra cover off Cook, and Rew was spilled by the diving Critchley at third slip. He fell before the close, but Banton's largely sensible knock had almost brought his side home when he edged a Snater catch.
It was left to Overton to hit the winning boundary off Porter in the second extra over of the day to give Somerset their first win of the season after four draws.