Hampshire 341 and 174 for 9 (McKenzie 67, North 5-30) lead Glamorgan 300 for 6 dec. (Rees 112) lead by 212 runs
Marcus North took five wickets as Glamorgan gave themselves a chance of victory against Hampshire at the end of the third day at Cardiff.
After Gareth Rees completed his first Championship century for 26 months, Glamorgan declared their first innings on 300 for 6 - 41 behind Hampshire. But Hampshire subsided to 53 for 6 before Neil McKenzie scored a vital half century in a 101 partnership for the seventh wicket with Sohail Tanvir.
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 offspin accounted for two wickets in an over. Wallace stumped Jimmy Adams before Liam Dawson was bowled.
From 28 for 3, Hampshire found themselves 50 for 4 when James Vince was run out from a direct hit by Hogan. Sean Ervine and Adam Wheater went in the space of four balls as Hampshire limped to tea at 75 for 6 - a lead of 116.
Tanvir took the attack to Glamorgan as he hit consecutive sixes in successive overs from Jim Allenby and Dean Cosker.
Already missing seamer Will Owen through injury, the hosts suffered a second setback when paceman Mike Reed pulled up while bowling. But McKenzie gave a sharp return catch to Allenby, who also caught Tanvir's at slip off North. And in the last over David Balcombe was bowled by North.
Rees's century helped Glamorgan, who resumed their first innings on 196 for 3, and it was quite a moment for the left hander who had not reached three figures in a Championship since May 2011. He brought up his century from 238 balls with 14 fours.
In the end Rees was the first wicket of the day to fall ending a 271-ball and 341-minute stay in the middle. He edged Balcombe to Dawson at second slip ending a fourth-wicket stand of 182 with Murray Goodwin.
That left Glamorgan 266 for 4 and with no addition to the score Goodwin fell 14 runs short of his third Glamorgan century hundred in the next over trapped lbw by Sohail Tanvir.
Glamorgan's blip continued as captain Mark Wallace was also out leg before to Tanvir for a duck. It saw the Welsh county subside from 266 for 3 to 272 for 6 in the space of 11 balls.
Glamorgan declared their second innings on 300 for six two overs after lunch in a bid to set up a game but they could never have hoped to slice through Hampshire's top order.