Foster issued a statement that said: "I accept the League's decision and am sorry that my mistakes have hurt my team. I have a responsibility to the 49ers, our fans and our community, and I am committed to learning from this situation and making better choices in the future. The support I have received over the last five months has been humbling, and I do not take it for granted."
In June, Foster pleaded no contest to a misdemeanor charge related to possession of an illegal weapon, stemming from a Feb. 11 incident in Los Gatos, California.
Foster was sentenced to 232 hours of community service and two years of probation in which he is barred from the possession of any guns or ammunition. He also must pay $235 in total fines and surrender the weapon that brought the charge, a Sig Sauer 516.
Foster's plea brought to an end a tumultuous offseason in which he at one time faced four charges, three of which were originally charged as felonies.
Soon after the season, Foster was arrested twice in the span of about a month: once in January in Tuscaloosa, Alabama, for possession of marijuana, a misdemeanor, and another in Los Gatos, California, which involved two charges related to domestic violence and the weapons charge.
His plea brought resolution to the most serious of those two arrests, as it was the final charge remaining from his Feb. 11 arrest in Los Gatos.
Elissa Ennis, Foster's former girlfriend, initially accused Foster of domestic violence before she recanted her story a couple of days after her initial complaint. She then testified under oath at the preliminary hearing on May 17 that she lied about Foster hitting her and that the injuries she showed to authorities were the result of a fight she was in on the night of Feb. 10.
Judge Nona L. Klippen dismissed the two charges related to domestic violence on May 23, citing a lack of evidence against Foster. On that same day, Klippen reduced the weapons charge to a misdemeanor on the basis that the weapon had been purchased legally in Alabama, and though it wasn't legal in California, it hadn't been used to commit a crime.
The marijuana charge Foster faced in Alabama was also dismissed on May 25 after he completed a diversion course and was asked to pay a $100 bail bond fee.
Foster entered the league as a first-round pick in 2017 after he failed a drug test at the NFL scouting combine when his urine sample was found to be diluted. That, in addition to his offseason legal issues, could factor in to any potential league punishment.
The 49ers issued a statement saying that Foster will be eligible to participate in preseason games and practices. He will sit the first two regular-season games and be eligible to return to the active roster Sept. 17.
ESPN's Nick Wagoner contributed to this report.