A federal judge on Wednesday blocked a new Texas law that would have banned a commonly used abortion method. It is the latest court defeat for a state legislature that has attempted to make it as difficult as possible to have an abortion in Texas, the country's second-most-populous state.

Austin-based U.S. District Judge Lee Yeakel extended indefinitely a temporary ban he previously issued before the law was set to take effect Sept. 1. That overturns — for now — a law that Gov. Greg Abbott (R) signed in June banning a second-trimester abortion procedure known as dilation and evacuation. Texas is set to appeal, but federal courts in at least four other states already had blocked similar laws.

Yeakel’s ruling followed a trial this fall in which the judge heard arguments from Texas, which defended the law, and from abortion rights groups who argued that it unconstitutionally burdens women seeking abortions.

Federal judges have already ruled against Texas’s past attempts to change the disposal of fetal remains and deny Medicaid funding to Planned Parenthood over videos secretly recorded by an antiabortion group. Last year, the U.S. Supreme Court gutted most of a sweeping antiabortion law approved in Texas in 2013 that helped force the closure of more than half of the state’s abortion clinics.

Texas for years approved tight abortion restrictions, arguing they would protect pregnant women. After the Supreme Court defeat, the legislature this session began backing proposals aimed at protecting fetuses, but always with top Republicans’ stated goal of reducing the number of abortions performed in their state to as close to zero as possible.

The Texas law that Yeakel suspended uses the nonmedical term “dismemberment abortion” to describe a procedure in which forceps and other instruments are used to remove the fetus from the womb. The office of Texas Attorney General Ken Paxton (R) had argued that “prohibiting this inhumane procedure does not impose any significant health risks or burdens on women” while citing alternative procedures that abortion providers say are less safe and reliable.

Federal courts previously blocked bans of the dilation-and-evacuation procedure in Alabama, Kansas, Louisiana and Oklahoma. Texas has about 20 abortion clinics, down from 41 in 2012.