An Alabama law that restricted abortion clinic doctors has been named unconstitutional.

In 2013, the state legislature approved a law that required doctors at abortion clinics to have admitting privileges at hospitals. However, U.S. District Judge Myron Thompson has ruled that lawmakers exceeded the scope of their authority in passing such a law, notes The Associated Press.

"The evidence compellingly demonstrates that the requirement would have the striking result of closing three of Alabama's five abortion clinics, clinics which perform only early abortions, long before viability," he said in the 172-page opinion.

A federal court struck down a similar law in Mississippi a few days ago.

Supporters said the law was in place to protect women and got them followup care, but Susan Watson, the executive director of the American Civil Liberties Union of Alabama, disagrees.

"These admitting privileges were not designed to make women safer," Watson said. "Major medical organizations, including the American Medical Association and the American College of Obstetrics and Gynecology, oppose them. We are proud to know that Alabama's women will continue have access to safe and legal abortions."

President and CEO of Planned Parenthood Southeast said the law was put in place to prevent women from having abortions because it had nothing to do with their safety.

"Politicians passed this law in order to make it impossible for women in Alabama to get abortions, plain and simple," she said. "This victory ensures that women in Alabama can make their own private health care decisions without the interference from politicians."

On the other side, law sponsor Republican Rep. Mary Sue McClurkin said the requirement would make clinics safer. But clinics said they couldn't meet this requirement and it was just a way to shut them down.

Thompson agreed and said the new measure would make it impossible for doctors to get admitting privileges in Mobile, Montgomery and Birmingham.