Craig Kieswetter smashed 84 from 42 balls to lead Somerset to a three-wicket victory over Gloucestershire and a Twenty20 Cup quarter-final spot.
Chasing 174 to win, the visitors were in trouble on 23-4 at Bristol.
But Kieswetter shared a fifth-wicket stand of 89 with Peter Trego (49) to help them home with an over to spare.
Somerset can now only finish as low as third in the Mid/West/Wales Division, but even that would see them through as one of the best third-placed teams.
In a see-saw game, the home side conceded six penalty runs for a slow over rate to reduce Somerset's target from 10 off 11 balls to just four.
Alfonso Thomas then hit the winning boundary off the last ball of the 19th over to send the Cidermen through to the last eight.
Earlier, Gloucestershire raced to 100 in only eight overs as Hamish Marshall (36), Kadeer Ali (33) and William Porterfield (32) put Somerset to the sword.
But Thomas (3-31) and Arul Suppiah (2-21) applied the brakes, as Gloucestershire lost their last nine wickets for 72 runs.