SAN MARCOS, Texas (AP) — Joshua Rowland kicked a 31-yard field goal late in the fourth quarter lifting Texas State to a 30-28 victory over South Alabama Saturday in a game that saw the lead swapped eight times.

South Alabama had a chance for the win, lining up for a 28-yard field goal that missed wide left with 1:36 remaining in the game.

Tyler Vitt was 23-of-33 passing for 373 yards and three touchdowns for the Bobcats (3-6, 2-3 Sun Belt). Trevis Graham Jr. caught scoring passes of 38 and 17 yards, Javen Banks pulled in a 40-yarder.

Desmond Trotter completed 13 of 17 passes for 164 yards and two touchdowns for South Alabama (1-8, 0-5). The Jaguars outgained Texas State 184-42 on the ground, with Tra Minter and Carlos Davis scoring.

But the 373 passing yards kept the Bobcats moving. After South Alabama took a 28-27 lead the Bobcats took over in good field position thanks to DeJordan Mask's 60-yard kickoff return. With the drive stalling at the 14, Rowland came on for the winning field goal.