LINCOLN–(AP May 22)–Nebraska Gov. Jim Pillen on Monday signed a bill that bans abortion at 12 weeks of pregnancy and restricts gender-affirming medical care for people younger than 19.

The abortion ban takes effect immediately after the governor’s signature, while the ban on gender-affirming care would take on Oct. 1.

Nebraska’s conservative-led, unicameral Legislature passed the bill with the two contentious issues on Friday after hours of heated debate. Conservative lawmakers wrangled just enough votes to end a filibuster and approve it. Bill opponents have promised to sue to try and block the law.

The proposal restricting gender-affirming care was the flashpoint of an epic filibuster led by Omaha Sen. Machaela Cavanaugh. She and a handful of progressive allies slowed the business of passing laws to a crawl by introducing amendment after amendment to every bill that made it to the Senate floor. That sent leadership scrambling to prioritize which bills to push through.

The hybrid measure tied together restrictions that Republicans have pursued across the U.S.

North Carolina also recently passed a 12-week abortion ban, among a slew of restrictions enacted in states after the U.S. Supreme Court last year struck down the 1973 Roe v. Wade ruling that established a nationwide right to abortion. Fourteen states have approved an abortion ban throughout pregnancy.

Nebraska had not passed a new ban since it became the first state to limit abortions around 20 weeks of pregnancy in 2010. The new 12-week ban will include exceptions for rape, incest and to save the life of the mother.

The bill also would prevent transgender people under 19 from receiving any gender-confirming surgery. It would also restrict the use of hormone treatments and puberty blockers in minors, putting the state’s chief medical officer — a political appointee who is an ear, nose and throat doctor — in charge of setting the rules for those therapies. In Nebraska, people younger than 19 are considered minors.

At least 17 states had already enacted laws restricting or banning gender-affirming medical care for minors before Monday, and proposals are pending before the governors of Texas and Missouri. Medical groups and advocates say such restrictions are further marginalizing transgender youth and threatening their health.

One Nebraska lawmaker, Omaha state Sen. Megan Hunt, disclosed in March that her teenage son is transgender and said Friday that she now plans to leave the state.

Supporters said they are trying to protect children from making decisions they might come to regret.