© Sergio Estrada-USA TODAY Sports

SANTA CLARA — On his seventh NFL team in three years, Raheem Mostert has clearly found his niche.

Mostert has been San Francisco’s No. 3 running back since the beginning of the 2017 season. He has just seven career rushes throughout a short but meandering career that featured mostly practice squads before he landed with the 49ers in the final weeks of the 2016 season.

Mostert is also San Francisco’s star special-teams gunner, which is where you’ve likely seen him blowing up returners. He adopted that role last year, compiling six special-teams tackles before going on the injured reserve in late November with an MCL sprain.

Through two weeks of action this season, Mostert has been the NFL’s best gunner, producing a league-leading five tackles. These aren’t arm tackles — they’re crunching hits.

Mostert’s most vicious hit of the season came last Sunday in San Francisco’s 30-27 win over the visiting Detroit Lions. Leading 10-7, the 49ers punted in the second quarter. Mostert erased any possibility of a return.

In today’s NFL, understanding legal tackling is more important than ever. Deploying a running back at a position that requires tackling may be risky for some players, but not Mostert, who was a high school safety and played special teams his freshman year at Purdue University.

In fact, Mostert has looked like one of San Francisco’s best tacklers through two weeks.

Back in the second week of the preseason, he was flagged for lowering his helmet on another hard tackle. By age-old football teachings, he used perfect technique.

Mostert expected to be fined by the NFL because he was penalized, but he never was — much to his surprise.

“They didn’t necessarily come out and say (it was an illegal hit),” Mostert said Wednesday. “I could just tell because I didn’t get fined.”

That play reminded Mostert to be cognizant of the new helmet rule. Now, each time he prepares for a tackle, he tries to avoid leading with his helmet’s crown, as difficult as that is for a guy who ran a 4.28 40-yard dash three years ago.

He has not been flagged yet, though the hard hits haven’t stopped.

Last Sunday, he recorded two tackles on kickoff returns and one (as displayed above) on a punt return. On his second tackle of the day, he chased down Lions returner Jamal Agnew and tossed him to the ground.

Those types of effort plays epitomize Mostert, who has stuck around the NFL for his versatility — a buzzword emphasized in Santa Clara.

When training camp opened, it was clear Jerick McKinnon and Matt Breida were the top two running backs. The battle for the third spot, however, was more precarious, featuring Mostert, Joe Williams, and Jeremy McNichols. Ultimately, Williams suffered a rib fracture, McNichols struggled, and former free agent Alfred Morris was acquired. He has nearly split rushing repetitions with Breida in the wake of McKinnon’s season-ending knee injury, delegating Mostert exclusively to punt and kickoff coverage.

Kyle Shanahan considered special-teams value when he mulled his No. 3 running back selection back in training camp. That clearly applied to Mostert, who has impressed his coach in the opening weeks of the regular season.

“Raheem is playing at such a high level,” Shanahan said after Sunday’s win. “He started with that last year. I think he was one of the better special teams players in the league last year and he has started off continuing that this year… He does a hell of a job for us in special teams, and there’s going to come a time this year, where we’re going to really need him on offense.”

That time has not come yet, though Mostert is ready.

“(I am) just waiting, man,” Mostert said. “Just being patient— that’s all I can do. If I can go out there and make a play on special teams, if that’s my role at the time, then that’s my role.”

So far, Mostert has thrived in his gunner role, which is straightforward but challenging. His job is to outrun the coverage and meet the punt returner, but he must account for various scenarios.

On punt returns, Mostert typically stands behind the line of scrimmage like a receiver — with his inside foot planted a couple feet ahead of his outside foot. That allows him to burst off the line without wasting time. He reads how his defenders are positioned to decide whether he sprints toward the middle of the field or up the sideline.

Whenever Mostert is double-teamed, he squats with his feet shoulder-width apart, as if he is a cornerback playing press coverage. The Vikings doubled Mostert on a punt in the second quarter, but the strategy didn’t work. He initially ran horizontally to avoid their jam, then sprinted upfield and eventually made the tackle.

Fast forward to the fourth quarter. The 49ers cut the Vikings’ lead to eight points with fewer than six minutes remaining. Mostert, again, was double-teamed, but he scampered along the sideline and crunched the returner before he could react.

The 49ers won by three points Sunday largely because of their excellent special-teams play. Rookie D.J. Reed returned a kickoff to the red zone, and the 49ers scored a touchdown shortly later. Kicker Robbie Gould made all six of his attempts — three field goals and three extra points.

In each of Mostert’s three tackles, he erased any hopes for a big gain, keeping the field advantage in San Francisco’s favor. He may not be running the ball, but his special-teams dominance has underscored his importance to the 49ers.

“It’s a lot of fun going down there and making plays,” Mostert said. “I love it. I enjoy it.”