RALEIGH, N.C. (AP) — North Carolina’s legislature has passed a bill requiring age verification on websites that publish material considered harmful to minors as lawmakers worked long hours this week to approve a state budget and other proposals.

The legislation, which passed the Senate and House Thursday with overwhelming bipartisan support, would require any company that intentionally distributes sexually explicit material to verify that the viewer is 18 years or older by using a commercially available database.

It now heads to Democratic Gov. Roy Cooper, who could sign it, veto it or let it become law without his signature. The strong bipartisan support indicates it will likely become law.

Companies are prohibited under the bill from retaining identifying information about an individual once they’ve been granted access to the website.

The legislation allows the parent of a minor to sue a company that violates the law by allowing their child to access sexually explicit material. Any adult whose personal information is retained by one of these websites also has grounds to sue.

Similar age verification requirements passed by other state legislatures have had varied success in court.

A federal judge struck down a Texas law requiring age verification and health warnings to view pornographic websites earlier this month and blocked the state attorney general’s office from enforcing it. The judge agreed with claims that the law violated free speech rights and was overbroad and vague.

In Utah, a state law requiring adult websites to verify the age of their users remains in effect after a federal judge in August dismissed a lawsuit from an industry group challenging its constitutionality. The judge noted the law does not direct the state to pursue or prosecute adult websites and instead gives Utah residents the power to sue them and collect damages.

State Sen. Amy Galey, an Alamance County Republican who introduced the North Carolina proposal, said age verification is an important tool that the state should be using to protect children.

“Moms and dads across the state of North Carolina are striving to protect their children from online predators in a number of different ways by monitoring their child’s use, by putting parental controls on their electronics,” Galey said during floor debate Thursday. “This will give them another important way where they can work to keep their children safe.”