The bill also bans medication abortion drugs from being sent through the mail.

The Kentucky state legislature has overridden Gov. Andy Beshear’s veto of a bill banning abortion after 15 weeks, along with several other abortion restrictions.

Under the bill, any physician that performs an abortion after 15 weeks would lose their license for at least six months.

The bill allows for exceptions if there is a medical emergency in which continuing the pregnancy would result in “serious risk of the substantial and irreversible impairment of a major bodily function” or “death of the pregnant woman.” There are no exceptions for rape or incest.

Last week, Beshear, a Democrat, vetoed the Republican-backed measure after he raised concerns about whether the bill is constitutional and criticized the lack of exceptions for rape or incest.

But Wednesday, the state House received well over the 51 votes needed to override the veto, and the state Senate far surpassed the 20 votes needed as well. It went into law immediately due to its emergency clause.

Also in the bill, which is known as HB3, is a restriction that drugs used for a medication abortion — a nonsurgical procedure typically used up to 10 weeks in pregnancy — must be provided by a physician who is licensed to practice medicine and in good standing with Kentucky.

The physician must also have hospital admitting privileges in “geographical proximity” to where the abortions are being performed.

An in-person examination needs to be had at least 24 hours prior to the medication abortion, during which women are informed about any risks. The drugs cannot be sent through the mail.

Abortion advocates say this will prevent many women, particularly those who are low-income, from accessing abortion if they must go to a clinic to receive it.

Additionally, minors who seek abortions will need the consent of a judge if the parents are not available, and any fetal remains will need to be buried or cremated by a licensed funeral provider.

Opponents argue the bill has so many restrictions that it makes it virtually impossible for any abortion clinic to comply and say its passage will mean Kentuckians effectively lose access to abortion care.

The bill also requires that the names of physicians who provide medication abortions be published and a state-run “complaint portal” to be set up so people can anonymously report abortion providers who are allegedly violating the program.

In a previous interview with ABC News, Meg Stern, director of the abortion support fund for Kentucky Health Justice Network, an advocacy group, said this could lead to complaints filed by people who have personal vendettas against abortion providers.

The ban is modeled after Mississippi’s 15-week abortion ban, which is being reviewed by the Supreme Court, with a decision expected in June on whether or not it is constitutional.

If the court determines the Mississippi bill is constitutional, this could mean Roe v. Wade is either overturned or fundamentally weakened.