San Francisco 49ers running back Raheem Mostert says he has elected to undergo knee surgery and will miss the rest of the 2021 season. 

"This gives me, without a doubt in my mind, the best possibility at coming back 110%. I have always come back stronger and I will this time too!" he said on Twitter on Tuesday.

On Monday, head coach Kyle Shanahan said it was expected that Mostert would miss approximately eight weeks with the injury. 

The 29-year-old was injured in Sunday's season-opener against the Lions in Detroit, rushing twice for 20 yards before departing.

This is Mostert's sixth year with the Niners after joining the team during the 2016 season. He rushed for 521 yards and two touchdowns in eight games last season.

San Francisco held onto win Sunday's game 41-33 and will be back in action against the Eagles in Philadelphia in Week 2.