The Minnesota Vikings rallied late to beat the San Francisco 49ers 32-31 Sunday night at US Bank Stadium. Minnesota's preseason finale is slated for Thursday night in downtown Minneapolis.

Sam Bradford started for the Vikings and finished 17/21 for 134 yards, but he was also sacked three times. Backup quarterback Case Keenum was 10/14 for 139 yards and two touchdowns.

Minnesota rookie running back Dalvin Cook rushed five times for 17 yards, while Jerick McKinnon led the Vikings with seven carries and 27 yards.

Terrell Newby's rushing touchdown with time expiring got the Vikings within a point of San Francisco, and quarterback Taylor Heinicke ran in the two-point conversion to give Minnesota the win.