Marcus North took four wickets as Glamorgan gave themselves a chance of victory against Hampshire at the end of the third day of their LV= County Championship Division Two match at Cardiff.
After Gareth Rees completed his first Championship century for 26 months, Glamorgan, who resumed their first innings on 196-3, declared their first innings on 300-6 - 41 behind Hampshire.
Rees notched 112 before his 271-ball and 341-minute stay in the middle ended when he edged David Balcombe to Liam Dawson at second slip, which also brought to an end a fourth-wicket stand of 182 with Murray Goodwin (86).
In reply, Hampshire subsided to 53-6 before Neil McKenzie scored a vital half century in a 101 partnership for the seventh wicket with Sohail Tanvir as they finished on 174-9 at stumps - a lead of 215.
Hampshire's troubles began when Stewart Walters hung on to a brilliant one-handed slip catch to dismiss Michael Carberry for a duck.
And it got better for Glamorgan as North's off spin accounted for two wickets in an over. Captain Mark Wallace stumped Jimmy Adams before Dawson was bowled.
From 28-3, Hampshire found themselves 50-4 when James Vince was run out and Sean Ervine and Adam Wheater went in the space of four balls as the visitors limped to tea at 75-6 - a lead of just 116.
Following tea, Tanvir took the attack to Glamorgan as he hit consecutive sixes in successive overs from Jim Allenby and Dean Cosker before McKenzie gave a sharp return catch to Allenby, who also caught Tanvir's at slip off North.
In the last over David Balcombe was bowled by North, who finished with 4-27 to give the hosts a chance of victory on the final day.