SANTA CLARA, Calif. (AP) — Alvin Kamara took a handoff on the fourth play of the game and had it punched out of his grasp for a lost fumble.

With Kamara fighting for the end zone as New Orleans tried to mount a comeback in the fourth quarter, he lost the ball again.

On a day when the Saints offense struggled against San Francisco’s stout defense, it sure didn’t help that one of its best players kept giving the ball away.

Kamara lost two fumbles, Wil Lutz missed a field goal and New Orleans had its scoring streak of 332 game snapped in a 13-0 loss to the 49ers on Sunday.

“As crazy as it is to say when you don’t score a point, there’s a lot of positive things that we did today,” quarterback Andy Dalton said. “But we weren’t able to finish, and we left a lot of plays out there. That’s the frustrating thing. This game could have been a lot different if we capitalized on those opportunities, but we didn’t do that today.”

After Kamara lost the fumble on the opening drive, the Saints (4-8) managed just three more first downs in the first half.

They managed to move the ball effectively in the second half but still couldn’t score, ending the longest active scoring streak in the NFL. New Orleans hadn’t been shut out since the final game of the 2001 season against San Francisco — the fourth longest stretch in NFL history.

“That’s frustrating, because we had some opportunities, and you’re not going to beat a good team unless you make plays that are there to be made,” coach Dennis Allen said. “If you turn the football over, you’re not going to beat a good team.”

The Saints moved the ball inside the San Francisco 30 on their first drive of the second half before stalling. They tried to go for it on fourth-and-5, but Ryan Ramczyk committed a false start and Lutz missed a 48-yard field goal.

They got even closer on the next drive when they got down to the 6. Dalton completed a short pass to Kamara, who fought to get into the end zone.

Talanoa Hufanga came over and knocked the ball free. Juwan Johnson nearly caught it in the end zone for a Saints touchdown. But the ball squirted loose after Johnson was hit by Hassan Ridgeway, and Dre Greenlaw recovered at the 1 to keep the Saints off the scoreboard.

“You can’t do that against a good team like this and a good defense,” Dalton said. “It’s just another opportunity that was missed.”

It marked the first time in Kamara’s career that he lost two fumbles in a game. He has lost four this season after losing only two in his first five years. Kamara declined to talk to the media after the game.

San Francisco then stopped the Saints after a first-and-goal from the 4 when Nick Bosa sacked Dalton on fourth down. The Niners ran out the clock from there.

“I feel like we played the game the way the game needed to be played,” Allen said. “There’s just some plays there that we have to make that make the difference in the game. To be a good team like that, those are the plays you have to make.”