Charlie Shreck and Anthony Ireland took three wickets apiece to give Leicestershire hope of victory against Glamorgan at Grace Road.
Leicestershire will take a 218-run lead into the final day after bowling the visitors out for 359.
Glamorgan began the third day on 126 without loss but after openers Gareth Rees and Jacques Rudolph departed only Graham Wagg managed to reach 50.
After Leicestershire made 500 in the first innings they therefore held a sizeable advantage that they had extended further to be 77 for one at the close.
Rudolph managed to add just two to his overnight total before he was run out by Matthew Boyce in the fourth over of the day on 65.
Fellow opener Rees reached 72 before he was bowled by Ben Raine as Glamorgan fell to 161 for two.
A solid 35 from Stewart Walters and 41 from Jim Allenby maintained the visitors' momentum.
But Shreck and Ireland moved through the tail before Wagg, who had taken four first-innings wickets to limit the Leicestershire damage, raised his half-century.
Wagg was last man out when caught by Rob Taylor off Shreck to bring an end to the Glamorgan innings at 359.
Ireland was the pick of the Leicestershire bowlers with 3-81 off his 27 overs, figures almost matched by Shreck, for whom the wicket of Wagg gave him a total of 3-84.
Leicestershire launched a solid reply in their second innings with Greg Smith and Boyce putting on 63 for the first wicket before Boyce was caught by Mark Wallace off Dean Cosker for 24.
Smith was unbeaten on 45 and Ned Eckersley joined him with seven as Leicestershire reached 77 for one at stumps.