The Gloucestershire Gladiators qualified for the Twenty20 Cup quarter-finals as group winners after beating Glamorgan Dragons by five wickets with three balls to spare in the Mid/West/Wales Division at Sophia Gardens.
Stand-in captain Alex Gidman was the hero with 52 from 35 balls after Glamorgan looked as if they were on course for victory.
Gloucestershire had been reduced to 127 for four by the home spinners, Dean Cosker and Robert Croft, in the 14th over.
That was after a turbo-charged start by Craig Spearman and Ian Harvey who put on 74 in 36 balls at the start.
But with the visitors' challenge seemingly fading - they required 37 from the last three overs - James Franklin handed them a lifeline.
Bowling with a wet ball, with the match having been played entirely in heavy drizzle, Franklin delivered two no-ball beamers and was taken out of the attack after five balls.
He had gone for 17 and the sixth delivery bowled by Richard Grant was dispatched by David Brown for six.
Though Brown was run out Gidman held his nerve to take the Gladiators into the last eight.
Earlier Grant (77 off 44 balls) and Michael Powell (51 off 41) had given Glamorgan a solid foundation with an opening stand worth 116 in 13 overs.
The 22-year-old Grant cracked five sixes as Gloucestershire struggled to contain the home side in difficult conditions.
Though Carl Greenidge only went for 20 from his four overs there were plenty of runs coming at the River end.
Harvey, back after missing the last game with a bruised thumb, went for 16 from his opening over with Powell getting in on the act, as the 50 partnership came up off 36 balls.
Grant himself reached 50 from 32 balls and then proceeded to hit Gidman for two sixes, one rebounding off the Press Box roof.
Powell produced two inventive scoop-sweep shots from Mark Hardinges as the Glamorgan 100 arrived in the 12th over.
But their momentum was dented when Grant was run out by a Chris Taylor throw to the wicketkeeper from backward point.
And another setback arrived when Brendon McCullum holed out on the midwicket boundary giving Ball a wicket from his first delivery.
Hemp and James Franklin produced useful runs towards the death but in the end it did not prove enough.