Youngster Kiran Carlson scored his maiden T20 half-century as Glamorgan denied Surrey the chance to go top of the T20 Blast South Group.
The 20-year-old from Cardiff hit 58 off 32 balls to help his side to a four-wicket win at the Oval.
Australia's Nic Maddison made an impressive 70 from 45 balls, including three sixes, as Surrey made 194-4.
After a bad start impressive hitting from Carlson, Craig Meschede and Graham Wagg helped Glamorgan get their target. Media playback is not supported on this device
Meschede (43) hit five sixes in a 19-ball innings and put on 50 for the third wicket with Carlson.
Wagg and Carlson made 63 for the fifth wicket before the youngster was caught at mid-off by Jade Dernbach off Rikki Clarke's bowling.
Wagg went on to make 46 not out and guide sixth-placed Glamorgan to a win with an over to spare and put them level on points with fifth-placed Surrey.
Media playback is not supported on this device
Yorkshire moved up to fourth place in the North Group after a convincing 60-run win over Leicestershire at Headingley.
New Zealand international Kane Williamson hit five fours and five sixes as he scored 77 off 41 balls, while Tom Kohler-Cadmore hit 53.
The pair put on 67 for the third wicket as the Vikings went on to make 187-5 in their 20 overs.
In reply Leicestershire got off to a fast start – Cameron Delport hitting two sixes and a four as he raced to 20 from just eight balls.
However, he was caught by Kohler-Cadmore off Jack Brooks' bowling in the first ball of the third over with the score on 24 – precipitating a collapse which saw the Foxes lose two wickets in each of the third and fourth overs to slump to 30-4.
Only three players scored more than 20 as the Foxes made 127-9 as Brooks finished with figures of 3-23.