Actor Danny Masterson has been charged with raping three women between 2001 and 2003, the Los Angeles District Attorney’s office announced on Wednesday.

Masterson, 44, was charged with three counts of rape, and faces up to 45 years in prison if convicted. He was arrested by the LAPD Robbery-Homicide Division on Wednesday morning, and was released in the afternoon on $3.3 million bail.

An arraignment has been set for Sept. 18.

The former “That ’70s Show” actor is accused of raping a 23-year-old woman sometime between January and December of 2001. He allegedly raped a 28-year-old woman in April 2003. And the charges allege that raped another 23-year-old woman at his Hollywood Hills home between October and December of 2003.

Tom Mesereau, Masterson’s attorney, issued a statement vowing to fight the charges.

“Mr. Masterson is innocent, and we’re confident that he will be exonerated when all the evidence finally comes to light and witnesses have the opportunity to testify,” Mesereau said. “Obviously, Mr. Masterson and his wife are in complete shock considering that these nearly 20-year old allegations are suddenly resulting in charges being filed, but they and their family are comforted knowing that ultimately the truth will come out. The people who know Mr. Masterson know his character and know the allegations to be false.”

Masterson has been under investigation by the LAPD since late 2016. He was dropped from the Netflix series “The Ranch” in December 2017, amid renewed focus on sexual misconduct in the wake of the Harvey Weinstein scandal. Masterson has vehemently and repeatedly denied the allegations.

The District Attorney’s office also said Wednesday that it had declined to file charges against Masterson in two other cases. In one of those cases, a woman alleged that she had been repeatedly raped by Masterson while living with him in 2002. Prosecutors declined to file charges due to insufficient evidence, according to a charge evaluation worksheet. In the second instance, a woman alleged that Masterson had raped her twice — once at his home, and once at hers — while she was unconscious in August and September of 1996. That case was declined due to the statute of limitations.

In August 2019, four women filed suit against Masterson and the Church of Scientology, alleging they were harassed and stalked in retaliation for going to the police.

Chrissie Carnell Bixler, one of the plaintiffs, alleged that Masterson repeatedly sexually assaulted her in late 2001 and early 2002. She was in a relationship with Masterson at the time, and alleges that on one occasion Masterson drugged her wine and anally assaulted her. According to the suit, Masterson admitted the following morning that he had assaulted her while she was unconscious.

A second woman, identified in the suit as Jane Doe #1, alleged that Masterson made her a drink during a party in April 2003, which made her feel sick and disoriented. She alleged that Masterson carried her upstairs and put her in the shower, after which she passed out on his bed. She alleged that she awoke to find him raping her, according to the suit. The date of the incident cited in the lawsuit matches the date of one of the rapes in the criminal complaint.

The criminal complaint does not identify any of the victims by name, instead referring to Jane Doe #1, #2, and #3.

When the suit was filed, Masterson said he was being “railroaded” and vowed to defeat his accusers in court and sue those “who jumped on the bandwagon for the damage they caused me and my family.”

A Church of Scientology spokesperson declined to comment on the charges.

The Masterson case predated, and was separate from, the “entertainment task force” created by District Attorney Jackie Lacey to oversee Hollywood sexual assault cases in the wake of the Weinstein scandal. The task force has looked at investigations involving about 40 suspects, and filed five charges against Weinstein in January.

George Gascón, who is challenging Lacey in the November election, previously cited the Masterson case as evidence that her office was dragging its feet on high-profile cases.

Update, Sept. 18: The arraignment has been postponed to Oct. 19.