With light fading and an electrical storm looming, Surrey hit their target of 47 runs off five overs when Alistair Brown hit a four off the penultimate ball.
A dogged Somerset batting display gave the West Country side a real chance of snatching a draw but Ben Hollioake, Jason Ratcliffe and Brown all hit sixes to bring Surrey victory just minutes before the heavens opened.
The Surrey captain, Mark Butcher, said: "We were talking about what Man United did against Bayern Munich before we went out to bat and we managed to turn it round and get the victory for ourselves. There are not too many championship games that go right down to the wire like that.
"It was a bit dark, and we expected a few wide deliveries but we got plenty of balls we could swing the bat at, which was handy. We were fairly confident at doing it because we had 10 wickets to start with."
Nottinghamshire pulled off a comfortable 261-run victory over the Championship leaders Hampshire inside three days at Trent Bridge. Smart bowling from Paul Franks, who took 4 for 25, speed the home team to victory.
Hampshire had been set 455 for victory but Mark Bowen ripped the heart out of Hampshire's batting with a spell of 3 for 13 in eight overs. Only Robin Smith's half-century held Nottinghamshire up, sharing a sixth-wicket partnership of 61 with Matthew Keech.
At Gloucester, thunder and lightning dictated a sudden end to the match between Gloucestershire and Essex. Rain stopped play at 2.55pm, with Essex 344 for 8 in their second innings, a lead of 209. An early tea was taken but 50 minutes later the game was abandoned as a draw.
Essex's Stuart Law raced to a superb century, having been 85 not out overnight. Law attacked from the start and reached 125.
Yorkshire wrapped up a nine-wicket win over Durham after two days and just one session on Saturday.Reuse content