James Tomlinson picked up five wickets and Danny Briggs chipped in with three as Hampshire clung on to their faint Championship division two promotion hopes.
Jimmy Adams’s side knew they needed a special bowling performance on the final day at Glamorgan, with the Welsh club set just 221 to win.
But dependable left-arm seamer Tomlinson stormed through the top order with figures of five for 44, reducing the hosts to 58 for five at one stage.
Murray Goodwin (56 not out) dropped anchor for his side, taking 170 balls to steer his men closer to their target.
But after captain Mark Wallace (44) became another Tomlinson victim, Hampshire were into the tail. Briggs (three for 33) did the damage as Glamorgan were bowled out for 179, sealing Hampshire’s win by 43 runs.
It meant Hampshire claimed only their second Championship win of the season and renewed hope they can drag themselves back into the promotion race.