UPDATE: Oct. 28, 2015, 2:08 PM ET

MONTGOMERY, Ala. (AP) — A federal judge on Wednesday ordered Alabama to restore Medicaid funding to Planned Parenthood, money the state tried to cut off in the wake of undercover videos shot by abortion opponents.

U.S District Judge Myron Thompson issued an order that temporarily bars Alabama from cutting off Medicaid contracts with the group’s clinics in Alabama. Planned Parenthood Southeast and a patient filed suit in August, days after Alabama Gov. Robert Bentley announced he was ending the Medicaid agreements with the two clinics.

“Today’s ruling is a victory for the women who rely on Planned Parenthood for quality, compassionate affordable health care,” said Staci Fox, president and CEO of Planned Parenthood Southeast. “It’s outrageous that Governor Bentley is trying to take care away from women and families in our communities who need it the most.”

In his 66-page opinion, Thompson said the state did not identify a legal reason to cut off funding to Medicaid and that the action likely violated a requirement of the federal Medicaid Act that prevents states from barring family planning providers for reasons unrelated to quality of care.

Alabama, Louisiana, Arkansas and Texas and Utah have all moved to block Medicaid funds to Planned Parenthood, triggering a series of court fights. Republican governors cited secretly recorded videos, shot by abortion opponents, which showed Planned Parenthood workers coolly discussing fetal tissue and fees for donating the tissue to researchers.

Alabama’s letter to Planned Parenthood did not give a reason for the termination of the provider agreement. However, Bentley cited the videos in statements he gave about the decision.

“The deplorable practices at Planned Parenthood have been exposed to Americans, and I have decided to stop any association with the organization in Alabama. As a doctor and Alabama’s governor, the issue of human life, from conception to birth and beyond, is extremely important. I respect human life and do not want Alabama to be associated with an organization that does not,” Bentley had said in a statement.

Planned Parenthood has said the videos, which implied some clinics were selling the tissue, were heavily edited to be misleading.

Lawyers for Alabama argued in court filings that the state was within its rights to end the Medicaid provider contracts, with or without cause. They also argued that the videos raised concerns by the governor that abortion methods might be chosen to obtain the best quality tissue, instead of what it is best for the patient.

Thompson, in rejecting the latter argument, said the two Alabama clinics do not participate in the fetal tissue donation program.

Unlike some states that have fought Planned Parenthood over funding, Alabama’s Medicaid program has paid little to Planned Parenthood.

Alabama Medicaid Agency records show that the state has paid Planned Parenthood Southeast less than $5,000 over the past two years. The payments were for contraceptives for low-income women. Medicaid does not pay for abortion except under rare circumstances.

Copyright 2015 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.