NEW YORK — New York has officially overturned a state law that allowed 14-year-olds to legally wed.

The Democratic-led Assembly and Republican-led Senate passed bills earlier in June that would increase the age of marriage.

Gov. Andrew Cuomo signed those bills into law Tuesday, officially raising the age of consent to marry from 14 years old to 18 years old.

“This is a major step forward in our efforts to protect children and prevent forced marriages,” Cuomo said.

Only two states now allow children as young as 14 to marry with parental and judicial consent: Alaska and North Carolina.

Child advocates say child marriage can trap minors and lead to sexual abuse and domestic violence. Research shows that woman who marry before 19 are 50 percent more likely than their unmarried peers to drop out of high school, and four times less likely to graduate from college. They’re also at a high risk of heart attack, diabetes, cancer and stroke.

Those aged 17 to 18 will now need court and parental approval to get married.

Cuomo designated the proposal a top priority in February.

“This administration has worked tirelessly to defend exploited and disadvantaged New Yorkers, provide minors with the rights and protections that they deserve, and ensure that women are empowered to have control over their own lives,” Cuomo said. “With this legislation, we continue to help protect those who cannot protect themselves.”