Virginia residents can now have consensual premarital sex without the possibility of being charged with a crime and a fine of up to $250.

Democratic Gov. Ralph Northam signed legislation Wednesday repealing the state's law, which was declared unconstitutional by the Virginia Supreme Court in 2005, that classified fornication as a Class 4 misdemeanor.

"We should not have laws that make most of the population into criminals," state Del. Mark Levine (D-Alexandria), who introduced the legislation to repeal the former law, told CNN . "Times are very different now than they were in the 17th and 18th centuries."

Levine, who first tried to repeal the law in 2018, told CNN that fornication was charged as a crime as recently as five years ago. It was piled onto existing charges for people accused of sex crimes, he said. The fornication law was listed under "crimes involving morals and decency" in the Code of Virginia.

"How is Virginia for lovers, if lovers can't love each other," Levine said, according to WTVR-TV , located in Richmond, Virginia. He told the CBS affiliate that he couldn't get the legislation out of committee last time he tried to repeal the fornication law.

Fornication, defined as having sex with another unmarried person, is still a crime in Idaho and Mississippi, both with a possible six-month jail sentence.

And in North Carolina , "if any man and woman, not being married to each other, shall lewdly and lasciviously associate, bed and cohabit together, they shall be guilty of a Class 2 misdemeanor."