California lawmakers on Monday passed legislation making prison time mandatory for certain sexual assault convictions, a measure inspired by the case of former Stanford University swimmer Brock Turner.

The bill, AB 2228, was passed unanimously and now heads to Gov. Jerry Brown's desk to be signed.

Under current California law, those found guilty of rape can be sentenced to probation. Prison time is only required in cases of sexual assault where force was used, but that meant cases in which the victims were unable to fight back because they were unconscious could not lead to prison time.

"Sexually assaulting an unconscious or intoxicated victim is a terrible crime and our laws need to reflect that," Assemblyman Bill Dodd, co-author of the legislation, said in a statement. "Letting felons convicted of such crimes get off with probation discourages other survivors from coming forward and sends the message that raping incapacitated victims is no big deal."

Turner was sentenced to just six months in jail after he was found guilty of sexually penetrating an intoxicated and unconscious 22-year-old fellow female student in January 2015.

Though his three convictions carried a potential sentence of 14 years in prison, Santa Clara County Superior Court Judge Aaron Persky sentenced Turner to six months confinement in the Santa Clara County jail to be followed by three years of probation. He was also ordered to register as a sex offender and participate in a sex offender rehabilitation program.

Turner is expected to be released from jail on Friday after serving just half of his sentence.