Most abortions will be banned after 12 weeks of pregnancy in North Carolina after Republican lawmakers voted to override Democratic Gov. Roy Cooper’s veto of the legislation.

There will be exceptions for instances in which the life of the mother is at risk. In cases of rape or incest, abortion will be banned after 20 weeks of pregnancy, and in instances of life-threatening fetal anomalies abortion will be illegal after 24 weeks.

The new law will go into effect July 1, replacing the state’s current law banning abortion at 20 weeks of pregnancy with no exceptions for rape or incest.

“Senate Bill 20 will save lives and provide needed support for women and families while putting North Carolina’s abortion law in line with [most of the] rest of the free world,” House Speaker Tim Moore, R-Cleveland, said in a statement.

The House voted 72-48 and the Senate voted 30-20 to override the veto, with every Republican voting in favor of overriding it and every Democrat voting against it. If one Republican in either chamber had voted against the veto override, it would not have had enough votes to pass.

In addition to changing the abortion cutoff, the new law establishes a 72-hour waiting period for both surgical and drug-induced abortions after the mother visits the physician for the first time in person. It also requires that, in the case of a drug-induced abortion, the woman’s first dose of the drug must be in the presence of a physician.

The new law also establishes eight weeks of paid parental leave for teachers and other state employees. It includes about $180 million for other initiatives, which include increased access to child care, support for foster care, and access to birth control.