San Francisco’s game-manager turned into quite the game-changer in an impressive performance.

Jimmy Garoppolo threw for 317 yards and four touchdowns on a night his team’s vaunted defense wasn’t at its best, and the San Francisco 49ers reached the halfway point of their season undefeated, beating the Arizona Cardinals 28-25 on Thursday.

For a quarterback who often gets the backhanded compliment of being a good game-manager, Garoppolo’s stellar performance provided some proof that the 27-year-old might be a little better than people think.

His teammates already knew.

“Yeah, he’s pretty good,” San Francisco 49ers tight end George Kittle said. “I don’t know why people don’t think he is. He makes some pretty gutsy throws out there, doesn’t he? Goodness gracious.”

San Francisco (8-0) fell behind 7-0 but responded with three touchdowns – one as time expired in the second quarter after Cardinals coach Kliff Kingsbury called a timeout and gave the 49ers a second chance on fourth down – to take a 21-7 halftime lead.

The 49ers were in control until about five minutes left in the fourth quarter, when Andy Isabella caught a short pass and sprinted for an 88-yard touchdown to help the Cardinals pull to 28-25.

But the 49ers were able to run out the clock on their ensuing offensive drive to end Arizona’s comeback. Garoppolo had two crucial third-down completions to keep the final drive alive, including one to Emmanuel Sanders who caught seven passes for 112 yards and a touchdown.

Garoppolo completed 28 of 37 throws including touchdowns of 30, seven, one and 21 yards.

“Our team has done a good job of winning in different ways this year,” Garoppolo said. “Whether it’s offense, special teams, defense or mixing and matching all of them. That’s how you create a good football team. You’re not relying on one part and everyone’s playing tomorrow. Complimentary football.

“That’s where we’re at right now.”

Even in victory and at 8-0, Niners cornerback Richard Sherman was downright grumpy when asked about the defense. Arizona had 357 total yards.

“It’s not about the results. The results are going to be what they are,” Sherman said. “Thank goodness our offense executed. But it’s about the process, it’s executing the way you’re supposed to. It’s about doing your job repeatedly, like with robotic consistency.”

Arizona (3-5-1) lost its second straight game. Rookie quarterback Kyler Murray threw for 241 yards and two touchdowns.

The Cardinals came into the game without their top two running backs, David Johnson and Chase Edmonds, who were battling injuries.

Kenyan Drake – who was acquired by the Cardinals on Monday in a trade with the Miami Dolphins – ran for 36 yards on the first play of the game and capped the opening drive with a 4-yard touchdown run. He finished with a team-high 110 yards rushing and 52 yards receiving.

“That’s what we expected from him, why we traded for him,” Kingsbury said. “His skill set is perfect for what we do. He’s explosive, he runs tough and to come and learn an entirely new offense, we didn’t hold anything back. We knew we could call our best game.”