Gov. John Kasich of Ohio. Thomson Reuters The Ohio legislature passed a bill on Tuesday that would ban abortion after the fetus' heartbeat can be detected.

The so-called heartbeat bill now heads to Gov. John Kasich, who hasn't said whether he'll sign or veto it.

Doctors can detect a fetus' heartbeat as early as six weeks into pregnancy. Women usually don't find out they're pregnant until four to seven weeks in — meaning the bill would most likely leave many women unable to get a safe, legal abortion in the state.

The bill doesn't provide exceptions allowing abortion in cases of rape or incest.

Abortion-rights advocacy groups, including Planned Parenthood and the Center for Reproductive Rights, decried the bill, calling it unconstitutional and saying it violates the Supreme Court's 1973 ruling in Roe v. Wade granting women a constitutional right to safe, legal abortions.

Republican Keith Faber, the president of the Ohio Senate, told the Associated Press that Trump's victory emboldened the legislature to pass the bill, with the hope that the courts would uphold it.

"I think it has a better chance than it did before" to survive a legal challenge, Faber said.

President-elect Donald Trump has said he wants to appoint justices who oppose abortion and would overturn the landmark case, leaving abortion rights up to the states.

"Clearly this bill's supporters are hoping that President-elect Trump will have the chance to pack the US Supreme Court with justices that are poised to overturn Roe vs. Wade," Kellie Copeland, the executive director of the abortion-rights group NARAL Pro-Choice Ohio, said in a statement. "We must prevent that from happening to protect women's lives."

"This bill would effectively outlaw abortion and criminalize physicians that provide this care to their patients."

Abortion-rights advocates protested outside the governor's mansion Tuesday night, encouraging Kasich to veto the bill:

Kasich's press secretary, Emmalee Kalmbach, declined to comment on whether he would sign the bill, according to The Columbus Dispatch.

He could also line-item veto the part of the bill banning abortion, The Dispatch reports, with Kathy DiCristofaro, the chair of the Ohio Democratic Women's Caucus, describing the abortion ban as being "tacked on as a last-minute amendment" to a bill addressing child-abuse prevention.

Though Kasich opposes abortion, he previously said he opposed the bill because of doubts over whether it would be constitutional.

The Ohio legislature on Wednesday was also considering a bill that would ban abortions after 20 weeks into pregnancy.

The ACLU of Ohio has threatened to sue if either bill becomes law. Other abortions-rights advocates would most likely join it.