LINCOLN, Neb. — Lawmakers passed a budget bill on Tuesday that could deny federal funding to Nebraska’s Planned Parenthood of the Heartland.

The measure, which was approved 38-6, heads to Gov. Pete Ricketts, who introduced the family-planning measure into the budget.

The bill would prevent health clinics from receiving Title X federal funding if they perform, counsel in favor of or refer patients to abortion services. Clinics would need to show physical, financial and legal separation from abortion services. The measure would allow referrals for abortion services in the case of an emergency.

Supporters said Planned Parenthood clinics could still be eligible for the family-planning funds, but other lawmakers argued the clinics won’t have time to legally separate their services before the measure becomes law.

Planned Parenthood only operates two of the state’s 42 health clinics that receive Title X funds, but it provides services to nearly one-third of Nebraska’s 28,000 Title X patients.

Sen. Anna Wishart of Lincoln said the bill unfairly targets Planned Parenthood. She voted in favor of the measure but said she fought to remove the language and is disappointed a better compromise could not be reached.

Supporters of the measure pointed to a 2016 state audit of Planned Parenthood that accused the organization of using public funds for abortion-related services. Supporters said services need to be separate in order to ensure money is not going toward abortion.

Planned Parenthood officials said the funds were miscoded by staff members.

Other opponents said attempts to regulate family planning do not belong in the budget. Sen. Patty Pansing Brooks of Lincoln said she questions the measure’s legality and expects it will be challenged in court.

The measure was heavily debated throughout the session and failed to advance twice. Failing to pass the budget could have created other problems within the state.