RALEIGH, N.C. (AP) — North Carolina lawmakers have finalized legislation to raise the minimum age to get married in the state from 14 or 16.

The Senate voted unanimously on Tuesday to accept House changes to the measure, which now goes to Democratic Gov. Roy Cooper for his expected signature. Children who are 16 or 17 would still be required to receive formal legal permission to marry. The age difference between the youth and their spouse could be no more than four years.

North Carolina had recently become a destination for out-of-state couples that included youths, as surrounding states had raised their minimum ages and made it tougher to wed.