The state Legislature has overturned a state law that allows 14-year-olds to legally wed, paving the way to end child marriage in New York.

The Democratic-led Assembly passed a bill Thursday that would increase the age of marriage to 17. The Republican-led Senate passed the measure earlier this week.

New York is one of three states that allows children as young as 14 to marry with parental and judicial consent. The other two are Alaska and North Carolina.