(Reuters) - A federal judge on Tuesday blocked Kansas Governor Sam Brownback's efforts to remove Planned Parenthood, a U.S. women's healthcare and abortion provider, from a government health insurance program for the poor in the state.

U.S. District Judge Julie Robinson issued the 54-page order for a temporary restraining order and preliminary injunction, ruling the state could not cancel Medicaid provider agreements with Planned Parenthood of Kansas and Mid-Missouri, or PPKM, and Planned Parenthood of the St. Louis Region and Southwest Missouri, or PPSLR.

"It is uncontroverted that PPKM and PPSLR serve hundreds of underprivileged women in the State of Kansas," Robinson said in the order. "It is in the public interest to allow these individuals to be treated by the qualified provider of their choice, and to have that provider reimbursed under Medicaid pending a trial on the merits in this case."

The Republican governor ordered state officials to cut off funding for Planned Parenthood and its affiliates through the state Medicaid program in January, saying the state would not fund an industry that disrespected life.

A spokeswoman for Brownback said in a statement on Tuesday: "The governor will continue the fight to make Kansas a pro-life state. We will review today's preliminary ruling and move forward with the litigation."

The state sought to cut funding after the release of videos secretly recorded by an anti-abortion group that activists said showed that Planned Parenthood officials in some states had discussed the sale of aborted fetal tissue.

Neither of the Planned Parenthood affiliates involved in the case participates in fetal tissue donation or sale, court records show.

"We are thrilled with the judge's ruling. We felt strongly that we were going into this on the right side of the law," said Laura McQuade, chief executive of Planned Parenthood Great Plains, formerly Planned Parenthood of Kansas and Mid-Missouri.

The two organizations, along with three of their patients who are on Medicaid, sued the state in May, arguing Brownback's order would break federal law and violate the U.S. Constitution.

Planned Parenthood has denied taking any illegal payments, calling the videos distortions of fetal-tissue donations. The organization has said it has received only reimbursements for its costs, which are legal under U.S. law.

Planned Parenthood said in May that at least two dozen states had cut or tried to slash funding to its clinics since the mid-2015 release of the undercover videos.

(Reporting by Curtis Skinner in San Francisco; Editing by Cynthia Osterman and Peter Cooney)