For indispensable reporting on the coronavirus crisis, the election, and more, subscribe to the Mother Jones Daily newsletter.

A federal judge Friday struck down a Kentucky law that required abortion clinics to have written agreements with an ambulance service and hospital in case of emergency, meaning the state’s last abortion clinic will be allowed to keep its doors open.

The decision is a big win for abortion rights advocates, who have been fighting to keep EMW Women’s Surgical Center open for the last year after Republican Gov. Matt Bevin’s administration argued the clinic’s license should be revoked because it did not have the proper agreements in place. Closing EMW would have made Kentucky the only state without an abortion clinic.

Although EMW actually did have agreements with a local hospital and ambulance service, Kentucky officials claimed they weren’t valid because of technicalities in the 1998 state law. Planned Parenthood joined the clinic in a lawsuit, filed last spring, that argued the state law imposed medically unnecessary obstacles for women seeking abortions. State officials had used the law to deny Planned Parenthood’s Louisville clinic a license to provide abortions.

In the ruling, Judge Greg Stivers found the decades-old state law unconstitutional and cited the Supreme Court’s 2016 decision in Whole Woman’s Health v. Hellerstedt, which struck down similar restrictions in Texas. The Texas law caused more than half of the state’s abortion clinics to close before it was declared unconstitutional.

“The challenged regulations are not medically necessary and do absolutely nothing to further the health and safety of women seeking abortions in the Commonwealth of Kentucky,” Stivers wrote. He noted that abortion poses “minimal risk” to a patient’s safety and that abortion-related complications occur in only a minuscule percentage of procedures. He also noted that if Kentucky’s last abortion clinic closed, women would have to endure the costly and difficult challenge of traveling to another state or risk performing self-induced abortions without medical help.

“In 37 years providing abortion, I’ve seen every [other] clinic close down in our state, and now ours is the last clinic standing in the entire state,” Dr. Ernest Marshall, EMW’s founder, said in a press release. “The patients that walk through our doors have already dealt with so many obstacles—I’m glad that despite those challenges, they will still find our doors open to them thanks to this victory.”