An unbeaten 151 by Ian Cockbain enabled Gloucestershire to hold Surrey to a draw after a huge first innings deficit had left them facing a crushing defeat.
After mustering just 112 in 31.4 overs on day one and seeing Surrey amass 626 in response, the home side faced a monumental task in trying to salvage anything from the game.
Beginning the final day on 274-5 and with centurion Michael Klinger already out, the visitors remained firm favourites to pick up most of the points. However, in an outstanding display of concentration, Cockbain batted for 421 balls and 525 minutes, hitting 17 boundaries in his match-saving knock, having been out for a duck first time around.
The number five batsman was ably assisted by Tom Smith's 80 as former-England bowlers Chris Tremlett and Jade Dernbach, among others, could take only six second innings wickets.
The match finished with Gloucestershire on 506, taking five points. Surrey picked up 12 points, leaving them six behind their opponents in fifth place.