In 2017, when California state Sen. Jerry Hill heard about a local 12-year-old girl getting married to a 28-year-old man, he thought it was just a sick rumor.

“It’s one of those, ‘You’re kidding me, that’s not happening here,’” Hill told NBC News.

Then he learned the truth: It was happening, and it was legal.

Hill discovered that child marriages occur in California because, like in many states, there was no minimum age to wed, and in still other states, the laws set the age below age 18, even if one spouse is years or decades older. Often, sometimes all it takes for the child to marry is the permission of a parent or a judge.

“One parent said it was OK, a judge checks the box, and it was done,” Hill explained.

Across the country, laws allowing minors to wed are common, experts say. A majority of states allow 16- and 17-year-olds to marry, and 17 states have no minimum marriage age, according to Tahirih Justice Center, a nonprofit that seeks to protect immigrant women and girls from violence.

Since 2016, 14 states have strengthened their marriage laws to set minimum ages and streamline the review process. But only seven have effectively banned child marriage, either by raising the marriage age to 18, with no exceptions, or carving out allowances for court-emancipated minors, who are considered legal adults.

Hill swiftly drafted a bill to make 18 the legal age to marry in California, thinking the community would be outraged, his colleagues angry and the issue quickly fixed.

But that wasn’t the case.

“I thought there would be a considerable amount of sympathy on the part of these young girls, in most cases, who were victims of child marriage,” the Democratic lawmaker said. “I felt there were some very compelling arguments that this would prevail. But the opposition came, and it was quite the surprise.”

State Sen. Jerry Hill speaks on the floor of the Senate in Sacramento, California, on Aug. 27, 2018. Rich Pedroncelli / AP file

Hill’s bill to raise the marriage age to 18 came under opposition from some fellow lawmakers as well as civil rights and other advocacy groups, such as the American Civil Liberties Union of Northern California and Planned Parenthood. The final bill, which passed in 2018, placed strict guidelines on judges who approve such marriages, requiring them to interview the parties, gain consent from parents, and report any suspicious circumstances, and also mandated counties collect data on child brides; but opponents of child marriage still denounced the bill for failing to set an age minimum.

Experts, advocates and state lawmakers told NBC News that the California case illustrates a larger struggle happening in statehouses across the country; as the movement to ban child marriage gains momentum, activists often face pushback, a lack of awareness among lawmakers and legislative deadlock.

"It’s a problem that hurts children, and the laws facilitate that," Jeanne Smoot, the senior counsel for public policy and strategy at the Tahirih Justice Center, told NBC News.

‘Wide-open potential for abuse’

Despite that many states allow children to wed, the federal government considers marriage under the age of 18 in foreign countries a “human rights abuse” that “undermines” policies abroad. Earlier this year, a Senate report revealed for the first time the extent to which legal loopholes within the U.S. immigration system have enabled thousands of men to bring child brides or fiancées into the U.S. over the past decade.

Advocates note, however, that states, which issue marriage licenses, are the first line of defense against child marriage, an issue that mainly affects young girls. According to the advocacy group Unchained at Last, nearly a quarter of a million children were married in the U.S. between 2000 and 2010 — the majority of whom were young girls marrying older men.

“Just like most of America, legislators are surprised that child marriage is an issue in the U.S. and in their respective states,” said Amanda Parker, a senior policy expert at the AHA Foundation, a women's rights group founded by activist Ayaan Hirsi Ali. “If they don't realize that it’s something that it is happening in their state, they’re not going to focus on it.”

Hill said after he introduced his legislation to set the marriage age at 18, he received a lot of pushback and the result was a “watered down” law.

“I got opposition from mostly legislators who felt there should be no limit," he said. "They would say, ‘If you're going to limit this, what about if you're pregnant? You shouldn't be limiting that if a pregnancy is involved.’”