Charged with three felonies, including domestic violence, Reuben Foster has been told by the San Francisco 49ers to stay away — at least for now, as the team’s voluntary offseason workout program begins and it waits to see what evidence emerges from his case.

Foster was arraigned Thursday, after having been arrested in February at the Los Gatos, Calif., home he has been sharing with his girlfriend. According to prosecutors, she told police that he “punched her in the head eight to 10 times,” resulting in a ruptured eardrum and bruising.

In addition to domestic violence, Foster was charged with forcefully attempting to prevent a victim from reporting a crime and possession of an assault weapon, as well as misdemeanor possession of large capacity weapon magazine, after authorities allegedly found a Sig Sauer 516 at his home. The second-year linebacker out of Alabama, a first-round pick by San Francisco last year, could face more than 11 years in prison if convicted on all counts.

Foster “will not participate in team activities as he is tending to his legal matters,” the 49ers said in a statement Sunday. “As previously stated, his future with the team will be determined by the information revealed during the legal process.”

The team had said Thursday that Foster “is aware that his place in our organization is under great scrutiny.” The San Francisco executives who put their names on Sunday’s statement — CEO Jed York, General Manager John Lynch and Coach Kyle Shanahan — could themselves be indicating a preference to avoid some scrutiny for still having the linebacker on their roster.

Some have wondered why Foster wasn’t released after being charged, particularly given the severity of the allegations and the fact that he has a troubled history. Questions about his character, some prompted by a “heated” incident with medical staffer that got him sent home from the NFL’s draft combine, plus a lingering shoulder injury caused the Butkus Award winner to fall in the draft. He also failed a drug test at the combine because of a diluted sample, and in January, he was arrested for marijuana possession in Tuscaloosa, Ala.

However, in addition to being a recent first-round pick, Foster played very well in his first season, finishing second on the 49ers in tackles and earning defensive rookie of the month honors in November. The team is almost certainly taking his talent into consideration, especially given that just over a year ago, it released cornerback Tramaine Brock less than a day after he was taken into custody on suspicion of felony domestic violence.

The longer Lynch and Shanahan keep a roster spot for Foster, who has a hearing on April 30, the more likely they are to face pointed questions about what behavior they do and don’t find unacceptable. However, by issuing the 24-year-old what amounts to an unofficial suspension, they are avoiding some public-relations headaches that would be caused by the sight of Foster at 49ers workouts.

Read more from The Post: