FARGO, N.D. — Gov. Jack Dalrymple of North Dakota approved the nation’s toughest abortion restrictions on Tuesday, signing into law a measure that would ban nearly all abortions and inviting a legal showdown over just how much states can limit access to the procedure.

Mr. Dalrymple, a Republican, signed three bills passed by the Republican-controlled Legislature in Bismarck. The most far-reaching law forbids abortion once a fetal heartbeat is “detectable,” which can be as early as six weeks into a pregnancy. Fetal heartbeats are detectable at that stage of pregnancy using a transvaginal ultrasound.

Most legal scholars have said the law would violate the Supreme Court’s finding in Roe v. Wade that abortions were permitted until the fetus was viable outside the womb, generally around 24 weeks. Even some leaders of the anti-abortion movement nationally have predicted that laws banning abortion so early in pregnancy are virtually certain to be declared unconstitutional by federal courts.

“Although the likelihood of this measure surviving a court challenge remains in question, this bill is nevertheless a legitimate attempt by a state legislature to discover the boundaries of Roe v. Wade,” Mr. Dalrymple said in a statement. The Supreme Court, he added, “has never considered this precise restriction” in the heartbeat bill.