MINNEAPOLIS (AP) — Brian Hoyer had the San Francisco offense humming after sputtering through the first two preseason games, passing for 176 yards and two touchdowns in the first half before the Minnesota Vikings rallied for a 32-31 victory over the 49ers on Sunday night.

Sam Bradford and the Minnesota starters again failed to reach the end zone, though Bradford was sharp when given time to throw. Jerick McKinnon scored on a 108-yard kickoff return in the third quarter, boosting his bid to take over that role.

Backup quarterbacks Case Keenum and Taylor Heinicke led a late charge, with Heinicke's hurdle over the pylon for the 2-point conversion on the final play giving the Vikings the win after Terrell Newby's touchdown run with no time left.

Hoyer found Marquise Goodwin wide open for a 46-yard touchdown strike and Carlos Hyde out of the backfield for a 24-yard connection, some evidence of how new coach Kyle Shanahan's scheme could pick up the pace after the 49ers were one of the league's lowest-scoring teams the last three years.

Goodwin, the former Olympic long jumper who had the fastest 40-yard dash time at the 2013 NFL combine, ought to help. Injuries buried him in Buffalo.

The backups were buzzing, too, with an 87-yard score by Raheem Mostert off a screen pass from C.J. Beathard on third-and-22 in the third quarter and a short touchdown run by Mostert in the fourth quarter.

An unchallenged starter for the first time in his nine-year career, Hoyer finished 12 for 17 with a 143.3 passer rating. He completed his first nine passes. Beathard took another step toward solidifying himself as the backup, too, despite having a pass picked off by Antone Exum.

The depth chart behind Hyde at running back is wide open, with Mostert (130 yards, six touches) and rookie Matt Breida (34 yards, eight touches) standing out.

With left tackle Riley Reiff, running back Latavius Murray and wide receiver Laquon Treadwell all playing their first preseason game, Bradford and the Vikings were close to full strength. But the protection was again problematic, and Stefon Diggs dropped two passes.

In 13 possessions for the first team over their first three games this month, the Vikings produced 11 punts and one field goal. They reached the 6-yard line in the second quarter but ran out of time before they could try another play.

REID PROTEST RESUMES

San Francisco strong safety Eric Reid observed the national anthem from one knee , in apparent resumption of the human rights protest he joined last season with then-teammate Colin Kaepernick. Goodwin and others had their hands on Reid's shoulders.

Reid later drew the ire of Vikings wide receiver Adam Thielen after lowering his shoulder into Thielen's chest during a reception in the second quarter. Reid kissed his flexed biceps muscle like Kaepernick used to do, before receiving an earful from Thielen in response to the necessity of the hit.

KICKING CONTEST

Marshall Koehn made a 58-yard field goal for the Vikings with room to spare, keeping the competition with Kai Forbath for the kicker job close. Koehn missed a 47-yard attempt a few minutes later after the interception, but he converted a 38-yard extra point after a penalty pushed it back.

SITTING OUT

49ers: FS Jimmie Ward (hamstring) was held out after being taken off the physically unable to perform list earlier in the week.

Vikings: TE Kyle Rudolph (leg) and DE Brian Robison (undisclosed) didn't suit up.

NOTABLE INJURIES

49ers: Five-time Pro Bowl LT Joe Staley was sidelined in the first quarter because of a knee injury, but he was walking around without displaying obvious discomfort or discouragement. ... LB Brock Coyle (knee) departed in the third quarter.

Vikings: LB Emmanuel Lamur left in the third quarter for a concussion evaluation. FS Anthony Harris (leg) was out in the fourth quarter.

More From KROC-AM