CHARLESTON, W.Va. (AP) — A child marriage bill was passed by the West Virginia Senate on Friday night after it was changed to prohibit anyone younger than 16 from getting married and to ban age gaps of more than four years for 16- and 17-year-olds.

The Senate passed the bill on a 31-1 vote. It now goes to the House of Delegates, which previously passed its own version. The legislative session ends Saturday.

“I want us to pass something because our current situation is intolerable,” Morgan County Republican Sen. Charles Trump said.

Currently, children can marry as young as 16 in West Virginia with parental consent. It allows anyone younger than that to get married with a judge’s waiver.

The Senate bill would remove the possibility that anyone younger than 16 could marry. Those ages 16 and 17 would have to obtain parental consent and they couldn’t marry someone more than four years older than them.

Existing legal marriages, including those done in other states, would be unaffected.

The bill was thought to be dead on Wednesday night when the Senate Judiciary Committee rejected it, but the bill was resurrected on the Senate floor Thursday and moved to Friday’s final vote.

According to the nonprofit group Unchained At Last, which seeks to end forced and child marriage, seven states have set the minimum age for marriage at 18, all since 2018. Supporters of such legislation say it reduces domestic violence, unwanted pregnancies and improves the lives of teens.

Trump said most states allow 16 and 17 year olds to marry with some requirements attached.

“I know this has been a contentious issue among a number of people,” Trump said. “My hope is this will be viewed as a reasonable and acceptable compromise and a necessary change to our law. It would bring West Virginia in line with the vast majority of states in the country.”

Although recent figures are unavailable, according to the Pew Research Center, West Virginia had the highest rate of child marriages among the states in 2014, when the state’s five-year average was 7.1 marriages for every 1,000 children ages 15 to 17.

Putnam County Republican Sen. Eric Tarr said he got married in high school at 17 and his first child was born five days after graduation. He said he liked Trump’s version of the bill because it “protects family.”