Freshman quarterback Lorenzo Nunez threw for two touchdowns and Pharoh Cooper turned a broken play into a 40-yard go-ahead scoring run to rally South Carolina to a much-needed 31-14 victory over UCF on Saturday.

Nunez ran for 123 in his first start while Cooper added a 35-yard TD catch to snap the Gamecocks' two-game losing streak.

Things looked dire for South Carolina (2-2), which trailed 14-8 and struggled to make critical yards against fired-up UCF (0-4) in the opening half. But behind Nunez, Cooper and linebacker T.J. Holloman's two interceptions, the Gamecocks turned things around.

After Cooper's scoring run made it 15-14, Nunez hit tight end Jacob August with a 13-yard touchdown pass. Nunez connected with Cooper on a 35-yard TD later in the period.

Elliott Fry had three field goals, including a career-long 52-yarder to start South Carolina's scoring.