The Iowa legislature passed a bill late Tuesday night to prohibit abortions after an unborn baby has a detectable heartbeat.

After a long, contentious debate, the state House passed the bill in a 51-46 vote, according to the Des Moines Register. State Senate File 359 now moves to Gov. Kim Reynolds for consideration. The state Senate passed the bill in February.

A spokesperson for Reynolds said the governor wants to see the final bill before commenting, but she is “100 percent pro-life.”

The bill would require abortion practitioners to test for the unborn baby’s heartbeat before performing an abortion. If a heartbeat is detected, the abortion would be prohibited except in cases involving medical emergency, rape, incest or fetal abnormalities deemed to be “incompatible” with life.

Previous versions of the bill included penalties for abortion practitioners who violate the measure and fewer exceptions for abortions, according to the report.

Because an unborn baby’s heartbeat is detectable by about six weeks of pregnancy, the bill would prohibit almost all abortions in Iowa. Abortion activists say it is unconstitutional.

Pro-life state Rep. Shannon Lundgren, a Republican, admitted that the legislation would challenge what the U.S. Supreme Court ruled about abortion in Roe v. Wade, KMA Radio News reports.

“The science and technology have significantly advanced since 1973,” Lundgren said. “It is time for the Supreme Court to weigh in on the issue of life. It has taken decades for the science to catch up with what many have believed all along, that she’s a baby.”

But pro-abortion Democrats argued the legislation will cost the state millions of tax dollars in lawsuits, and infringe on women’s so-called “right to choose.”

No House Democrats voted for the bill, and six Republicans voted against it, according to The Gazette.

The goal of the legislation is to prevent the deaths of thousands of unborn babies every year. However, even some pro-life advocates admit that the success of the legislation is uncertain. While the rationale behind the bill is noble, many pro-life leaders recognize that, for the present, such bills may create unintended consequences that could hamper the pro-life cause.

Follow LifeNews.com on Instagram for pro-life pictures and the latest pro-life news.

Because of the current make-up of the U.S. Supreme Court and lower courts, a law to prohibit abortions in the first trimester most likely would not survive a court challenge. President Donald Trump promised to appoint pro-life justices to the courts, but he would have to appoint at least one more Supreme Court judge before the Iowa legislation would have a chance of being upheld. Currently, only four of the nine U.S. Supreme Court justices possibly would uphold a heartbeat law or overturn Roe.

North Dakota and Arkansas passed heartbeat bills several years ago, but federal courts struck down both laws.

The Eighth Circuit Court of Appeals said the following about its ruling on the six-week ban: “Because there is no genuine dispute that (North Dakota’s law) generally prohibits abortions before viability — as the Supreme Court has defined that concept — and because we are bound by Supreme Court precedent holding that states may not prohibit pre-viability abortions, we must affirm the district court’s grant of summary judgment to the plaintiffs.”

When courts rule against such laws, state taxpayers often are forced to reimburse pro-abortion groups for their legal fees.