Surrey 382 (Burns 113, Jacks 88, Clark 63*) and 195 for 7 (Jacks 62, Aldridge 4-61) beat Somerset 180 (C Overton 29, Worrall 3-28, J Overton 3-24, Atkinson 3-40) and 394 (Gregory 110*, Goldsworthy 67) by three wickets
Will Jacks' second half-century of the match guided leaders Surrey to their fourth LV= Insurance County Championship win of the season, a three-wicket success against Somerset at Taunton.
But the home side put up a valiant fight on the final day, Lewis Gregory finishing 110 not out, his fourth first-class century, and Peter Siddle making 42 to extend their second-innings total from 319 for 8 overnight to 394 all out.
That set Surrey 193 to win in excellent batting conditions. They slipped to 70 for 3 before Jacks followed his first-innings 88 with 62 in a total of 195 for 7. Kasey Aldridge claimed a career-best 4 for 61.
Surrey took 22 points from the game and Somerset only one. It was the home side's fifth defeat in seven Championship games and saw them slip to second from bottom of the First Division table.
Somerset's ninth-wicket pair of Gregory and Siddle battled away for more than an hour and a half at the start of the day, neither looking in any trouble.
Unbeaten on 71 at the outset, Gregory carried on where he had left off the previous evening, batting with confidence on the now placid surface. A back-foot forcing shot off leg-spinner Cameron Steel through the covers for his eighth four brought up his hundred off 166 balls.
Siddle looked equally assured as the partnership grew to 91 before the Australian fell lbw to a very full leg stump delivery from Dan Worrall.
Somerset still required a last-wicket stand to hold out much hope. But Marchant de Lange edged his second ball through to the wicketkeeper to give Worrall his third wicket.
There was time for three overs of the Surrey second innings before lunch. Ryan Patel struck two fours off Siddle to help take the score to 21 by the interval.
Patel and first-innings centurion Rory Burns continued to be positive at the start of the afternoon session, the latter pulling Gregory over mid-wicket for six.
Everything was looking straightforward for the visitors until a major wobble on 65, begun by Burns, on 25, pulling a catch to fine-leg off Aldridge.
Without a run added, Patel was brilliantly caught at slip, one-handed to his left by Gregory off the left-arm spin of Roelof van der Merwe.
Jamie Smith could make only four before having his off stump uprooted by Aldridge and, at 70 for 3, Surrey were suddenly on the back foot.
Tall seamer Aldridge went past the outside edge several times. But Ben Geddes and Jacks were unmoved, gradually averting any thought of a crisis.
They built steadily until Jacks eased the tension with three fours in an over off van der Merwe. By tea, the pair had added 58 and a further 65 runs were required.
In the final session, Jacks was given a life on 38 when Tom Abell spilled a straightforward chance at second slip off the impressive Aldridge, who struck later in the same over as Geddes, on 25, pulled a short ball straight to square leg.
That brought in Hashim Amla, unable to bat higher after a spell absent from the game through illness, with the total 137 for 4 and 56 needed. He fell for nine, lbw to Siddle, and when Abell atoned for his earlier miss with a fine diving slip catch to send back Cameron Steel, Surrey still required 32.
Jacks had hit 12 fours before having his middle stump ejected by Siddle. Jordan Clark and Jamie Overton saw Surrey to their target, leaving Somerset with precious little to show for a hugely spirited effort.