For the past four decades, a loophole in North Carolina's sexual assault law has gone unchecked: A man can't be guilty of rape if a woman agrees to sex — even if she withdraws her initial consent.

Another loophole has also persisted: It's not a crime to have sex with someone who is incapacitated, such as through drugs or alcohol, if that person was responsible for their own condition.

But those legal loopholes are on their way to being closed after lawmakers in the state Senate and House, which are both Republican-controlled, voted unanimously Thursday to pass a bill that includes language explicitly addressing such forms of sexual assault. Senate Bill 199 now goes to Gov. Roy Cooper, a Democrat, who is expected to sign it, according to Democratic lawmakers.

Cooper's office said in a statement Thursday evening that he is "carefully reviewing" the bill, and is supportive of policies that "protect victims, particularly those too young to advocate for themselves."

The bill's passage is "an incredible victory for women's rights and protections for victims of sexual assault," said state Sen. Jeff Jackson, a Democrat representing Mecklenburg County.

Jackson had tried unsuccessfully for the past four years to get his own bill regarding the revoking of consent to advance in the Senate. But getting the "right to revoke" language, which is not gender specific, tacked onto SB 199 this legislative session proved to be the best course.

"This is the most common sense piece of legislation we'll ever pass," Jackson, a former prosecutor, said, adding, "Every year victims would call us, share their stories and ask why this loophole still existed."

The loophole stemmed from a 1979 decision by the North Carolina State Supreme Court that set precedence in determining that "if the actual penetration is accomplished with the woman's consent, the accused is not guilty of rape, although he may be guilty of another crime because of his subsequent actions."

North Carolina has found itself behind the curve with regard to criminalizing certain types of sexual assault — in 1993, it became one of the last states to make marital rape illegal.

SB 199 also incorporates language from a separate House bill, co-sponsored by Rep. Chaz Beasley, a Democrat in Mecklenburg County, that makes it illegal to tamper with someone's drink, regardless of whether or not they were sexually assaulted. In addition, it makes it illegal to have sex with a person who is incapacitated, even if it's due to that person's own behavior.

SB 199 began as a way to strengthen protections for victims of child sexual abuse.

The North Carolina Coalition Against Sexual Assault, which has advocated for the various bills, has said previous bills failed to gain traction because there remains a strong stigma surrounding discussions about sexual behavior.

Leah McGuirk, who has previously testified in support of tightening sexual assault legislation, said she hopes perpetrators hear about the bill and it makes them "think twice" about targeting people.

McGuirk was at a bar in Charlotte, North Carolina, last year when she believes someone slipped drugs into her drink. While McGuirk was not sexually assaulted and had no idea who was responsible, she learned that under state law she wasn't considered the victim of a crime.

Now, she said, that's set to change.

"This is going to help so many different victims — I'm so overwhelmed and elated," McGuirk, a journalism student at the University of North Carolina at Chapel Hill, said. "It's a protection that was missing for so long."