San Diego State needed a spark on offense and Lucas Johnson delivered.

Johnson threw TD passes to Jesse Matthews in both overtime periods for his only completions of the game as No. 24 San Diego State finally got going offensively after a rough regulation and beat San Jose State 19-13 Friday night.

Johnson relieved an ineffective and banged-up Jordon Brookshire in the fourth quarter and came through in overtime after a few shaky moments in regulation.

"We just thought we were a little stagnant and we needed to do something different," coach Brady Hoke said.

Neither team scored a touchdown in regulation before Johnson delivered a 14-yard pass on the opening possession of overtime for the Aztecs (6-0, 2-0 Mountain West).

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

Tyler Nevens answered with a 1-yard run for the Spartans (3-4, 1-2).

But Trenton Thompson intercepted Nick Nash to start the second overtime to set the stage for Johnson and Matthews.

"We’ve never been in a game like that before," Thompson said. "It was a crazy one for us."

That set the stage for Johnson and Matthews to end it with a 24-yard pass on third down against man coverage to help San Diego State improve to 6-0 for the second time in 46 years.

"I love that matchup all day," Johnson said. "He went up and made a spectacular play two times. I give a lot of props to him."

The game was an offensive slog with the teams combining for 14 punts, four field goals, one fumble, one missed field goal and a turnover on downs without scoring a touchdown in regulation.

The game went to overtime when San Jose State let the clock run down and spiked the ball on third down to set up a 52-yard field goal try to Matt Mecurio with 20 seconds left.

Mecurio made kicks from 32 and 48 yards in regulation to match field goals from 52 and 26 yards by San Diego State's Matt Araiza.

Araiza was the star of the game in regulation for San Diego State, delivering an 86-yard punt in the third quarter and backing the Spartans up to their 5 with a 53-yarder late in the fourth quarter.

THE TAKEAWAY

San Diego State: The Aztecs came into the game 10th in the nation in rushing at 244 yards per game, but could get nothing going at all against the Spartans as the offense showed it's not at the same level as the Aztecs stingy defense. San Diego State finished with 70 yards on 36 carries.

San Jose State: The Spartans fell just short in trying to beat a ranked team for the first time since topping No. 16 Fresno State 62-52 in 2013. They have lost eight straight against ranked teams and 29 of the last 30.

FLAG DAY

The Spartans were flagged for offsides on two punt plays in the first half. The first didn't prove costly because Jordan Brookshire lost a fumble after the drive was extended. But the second one led to points. The Aztecs opted for a field goal after that penalty and Araiza delivered a career-long 53-yard field goal to make it 3-0 early in the second quarter.

The Spartans finished with 12 penalties.

UP NEXT

San Diego State: Visit Air Force on Oct. 23.

San Jose State: Visit UNLV on Thursday night.