SANTA CLARA — Reuben Foster’s misdemeanor marijuana case in Alabama was dismissed Friday after the 49ers linebacker completed a diversion course there.

Tuscaloosa County Assistant District Attorney Hunter Brown said that Foster took a substance-abuse course and successfully passed drug screenings as part of the program. Brown said Foster was able to complete the program remotely, something that is commonplace in Tuscaloosa given the number of college students who live elsewhere. Foster played at the University of Alabama and was arrested there on Jan. 12.

That reduced the number of pending charges against Foster, which just a few days ago was four, to one. Earlier this week, a judge in Santa Clara County threw out the two charges relating to domestic violence that had been waged against Foster. She also reduced the illegal firearms charge from a felony to a misdemeanor. Foster has a June. 6 court date to address that charge.

Foster, who agreed to stay away from the team facility while his domestic violence case was being considered, returned to the team Thursday.

Though Foster no longer is facing a marijuana charge in Alabama, he is subject to review under the league’s substance abuse policy and could be suspended a number of games for that.

Foster also failed a drug test at the 2017 scouting combine due to a diluted sample taken then and presumably entered the NFL’s substance abuse program at that point.

In addition, the police report regarding Foster’s domestic violence arrest, which occurred a month after his arrest in Alabama, makes note of the “very strong smell of burnt marijuana” inside the home at which Foster, his ex-girlfriend and a friend of Foster’s were staying at the time.