Skipper Ben Brown equalled a Sussex wicketkeeping record with six second innings catches as his side claimed a thrilling 28-run Specsavers County Championship win over Gloucestershire at Cheltenham.
The hosts were dismissed for 247, chasing a victory target of 276, with Jofra Archer taking four for 29 and Ollie Robinson four for 49. James Bracey was last man out for 87 when a memorable contest was finally decided.
Gareth Roderick contributed 66 to a fifth-wicket stand of 138 with 21-year-old Bracey, who faced 174 balls, hitting 10 fours.
But in the end the pace bowling of Archer, who had match figures of eight for 91, and Robinson proved decisive in a match where the outcome was still in doubt at tea on the final day.
Sussex took 21 points to keep their promotion hopes alive, while the home side, who went into the game bottom of the Second Division, had to settle for six.
Skipper Brown said: "I'm delighted for Ollie Robinson that he took the final wicket because he was our stand-out bowler in the match, going past the outside edge relentlessly.
"It was an emotionally draining game to play in, but we have had a really enjoyable time playing at Cheltenham on a lovely ground and a good pitch.
"Records are alway nice from a personal point of view and I'm pleased to have taken six catches, but the huge high of the win is mostly on my radar at the moment. It keeps us on the coat-tails of Kent and Warwickshire.
"James Bracey did not deserve to be on the losing side. He played a brilliant innings, lining up the ball well and showing a great temperament in a day four run chase."
The day began with Gloucestershire 30 for two and a pair of nightwatchmen at the crease in Matt Taylor and George Drissell. The move backfired as both fell early to Robinson and Archer respectively and Sussex had their tails up with the hosts 38 for four, Brown having been involved in every dismissal.
A fascinating see-saw contest turned again when Bracey and Roderick settled in to bat with few alarms in bright sunshine, taking the score to 125 for four at lunch, with a further 151 required.
Left-hander Bracey was first to his half-century off 90 balls, with 7 fours. And when Roderick followed him to fifty from 97 deliveries, with eight boundaries, Gloucestershire began to look favourites.
Roderick pulled a six off Davis Wiese as the stand reached 138 before fortunes swung again when he was bowled leg stump looking to sweep left-arm spinner Danny Briggs.
It was 176 for five, with exactly 100 still needed, and Sussex sensed their chance. With 21 added, Graeme van Buuren fell to a slip catch off Chris Jordan for 14 and when Ryan Higgins was caught down the leg-side by Brown off Archer the scoreboard read 215 for seven.
Bracey was looking unflappable and it seemed the hosts might reach tea without further loss. But Robinson had other ideas and Kieran Noema-Barnett became the fourth Gloucestershire player caught down the leg side, Brown taking his sixth catch.
With a new ball due soon after interval and 34 runs still needed, Sussex looked marginally the more likely winners.
That became more certain when Craig Miles was pinned lbw by Robinson with only two added in the final session.
The new ball was taken at 246 for nine, with 30 needed, and it quickly accounted for Bracey, well caught diving forward at deep square by Briggs to give Robinson his fourth wicket.
Brown was quick to offer a consoling handshake to Bracey, who left the field with head bowed after enhancing his growing reputation.