It would have seemed unfair if the Vikings lost Sunday because of a fumble by Alexander Mattison. Filling in for injured starter Dalvin Cook, the 23-year-old running back had been one of the few bright spots for a Vikings offense that has scored only two touchdowns in its past eight quarters.

Yet it very nearly happened that way.

Mattison, who scored the Vikings’ only touchdown — and did most of the work — on a 15-yard pass from Kirk Cousins, and set the Vikings up on the Detroit Lions’ 25-yard line with a 48-yard run up the middle in the third quarter.

He finished the game with 113 yards on 25 carries, plus seven pass receptions for 40 yards in the Vikings’ 19-17 victory at U.S. Bank Stadium. Yet at the podium afterward, Mattison spent a lot of time falling on his sword because of a fumble that led to a go-ahead touchdown by the Lions with less than a minute to play.

Stood up on third down from the Vikings’ 20-yard line, Mattison had the ball stripped away from him by linebacker Jalen Reeves-Maybin with 2 minutes left.

Newsletter signup for email alerts

“That was a play where we were trying to have a four-minute offense, and it’s a play where you’ve got to know when the fight is over. Forward momentum probably was stopped but they didn’t blow the whistle,” Mattison said. “So, we’ve just got to make sure that we play whistle to whistle and make sure stuff like that doesn’t happen again.”

The Lions made short work of that 20 yards, scoring a touchdown on three plays, one of them a 17-yard run by D’Andre Swift on first down. A Jared Goff pass to receiver KhaDarel Hodge on the two-point conversion gave the Lions a 17-16 lead with 41 seconds left on the clock.

The lesson, Mattison said, was “just understanding when the battle is over. Just knowing when you kind of just gotta let it be. Situational football, and just knowing that you don’t have any timeouts.

“So, for me, not trying to get an extra yard or two, just trying to protect the ball, get down.”

It would have been a disaster had the Vikings not driven to the Lions’ 36-yard line in 36 seconds to set up Greg Joseph’s winning field goal. Instead, the Vikings are 2-0 with Mattison as their starting tailback.

Mattison said he learned before Sunday’s noon kickoff that an ankle injury would hold Cook out for the second time this season. The first time, Mattison ran 26 times for 112 yards and caught six passes for 56 yards in a 30-17 victory over the Seattle Seahawks in Minneapolis.

He now leads the Vikings in rushing with 258 yards on 65 carries in five games. On his touchdown Sunday, he caught a short pass from Cousins in the middle of the field and broke at least four tackles before grinding his way into the end zone for a 13-3 lead with 2:29 left in the first half.

The game, he said, “was a little bit of an emotional roller coaster toward the end there,” adding that afterward he talked to Joseph, who missed a potential game-winning kick Sept. 26 in Arizona.

“He said, ‘You got my back, I got your back,’ ” Mattison said. “And so that’s what this team is about. We go in there, we fight together every single day. We put in the work so we can get better every single day so we can go out there on Sundays and perform and have each other’s back.”