SAN JOSE, Calif. -- Tyler Ervin rushed for three touchdowns and a San Jose State single-game record 300 yards on Saturday night to help the Spartans beat Fresno State 49-23.

Ervin's rushing total was the most in an FBS game this season. His 42 carries were a career high.

Joe Gray completed 20 of 23 passes for 252 yards and three touchdowns for San Jose State (2-2, 1-1 Mountain West). The Spartans finished with 543 total yards and 33 first downs while nearly doubling Fresno State in time of possession.

More from FoxSports

A 30-yard touchdown run by Ervin gave the Spartans a 28-10 lead with 11:18 left in the third, but a 29-yard touchdown pass from Ford Childress to KeeSean Johnson and a 5-yard scoring run by Jamire Jordon trimmed the Fresno State (1-3, 0-1) deficit to 28-23 -- Kody Kroening missed the PAT attempt -- just more than five minutes later.

Gray had a 49-yard touchdown pass to Tim Crawley and a 9-yard scoring to toss to Billy Freeman before Jimmy Pruitt's pick-6 sealed it for San Jose State.