Ohio lawmakers passed a bill that would prohibit abortion as soon as a fetal heartbeat can be detected — at around six weeks, before many women realize they are pregnant. Here's what you need to know about the bill. (Thomas Johnson/The Washington Post)

Ohio Gov. John Kasich on Tuesday vetoed a controversial bill that would have banned abortions as early as six weeks into pregnancy but signed a measure prohibiting the procedure later in pregnancy.

The measure the Republican governor rejected would have barred a woman from obtaining an abortion if a fetal heartbeat could be detected. The legislature passed the measure last week even though it conflicts with Supreme Court decisions upholding the right to abortion at least until the point at which the fetus is viable. The bill he signed, banning the procedure at 20 weeks of pregnancy, may run afoul of these rulings, because viability is generally interpreted to be around 24 weeks.

In a statement, Kasich said he vetoed what has been called the “heartbeat bill” because it was “clearly contrary” to Supreme Court rulings. The state would have been forced to spend hundreds of thousands of dollars trying unsuccessfully to defend the law and would have provoked lawsuits that would end up rolling back other restrictions enacted by the state, he said.

In a separate statement, he said he agreed with major antiabortion groups that have preferred to challenge precedent with the 20-week ban, which he said “is the best, most legally sound and sustainable approach to protecting the sanctity of human life.”

Abortion rights groups condemned Kasich’s support for the 20-week ban, which has no exception for rape or incest and has an exception for the life of the mother that rights groups said was too narrow.

“He thinks that by vetoing one abortion ban Ohioans will not notice that he has signed another,” Kellie Copeland, NARAL Pro-Choice Ohio’s executive director, said in a statement. “Kasich’s actions today will fall hardest on low-income women, women of color, and young women. History will not judge Gov. Kasich’s disregard for women’s health kindly.”

Ohio becomes the 16th state to ban abortion at around 20 weeks, based on the contention that fetuses may be able to feel pain at that stage. Most experts believe that point comes later in fetal development.

While abortion rights advocates on Tuesday focused on the bill Kasich signed, the more restrictive measure drew more attention over the past week because it would have banned the procedure before many women realize they are pregnant. Two other states, Arkansas and North Dakota, recently passed abortion bans at a very early point in pregnancy, but the measures were blocked by the courts.

Several other states considered such measures but stopped short after some antiabortion groups worried that they would provoke a legal backlash that further cements abortion rights.

Still, Ohio lawmakers — emboldened by the election of Donald Trump — approved the bill as a new offensive to curb abortion rights. Trump has pledged to appoint justices who oppose Roe v. Wade, the 1973 Supreme Court decision that legalized abortion nationally.

The law may yet be enacted if the legislature overrides Kasich’s veto. In Ohio, that requires a three-fifths majority in each chamber.