SALT LAKE CITY -- A federal judge has overruled Utah Governor Gary Herbert's directive that state agencies can no longer funnel federal dollars to Planned Parenthood of Utah.

In an abruptly scheduled hearing on Tuesday, U.S. District Court Judge Clark Waddoups granted Planned Parenthood of Utah's request for a temporary restraining order, halting the state from defunding the organization.

In arguments in federal court, Planned Parenthood's lawyer urged the judge to issue a temporary restraining order blocking the state from refusing to hand over federal grant money to the group. Attorney Peggy Tomsic argued that the group was entitled to the funding that it has received for 20 years without any problems.

Planned Parenthood has come under fire for a series of videos released by anti-abortion activists that have showed executives of the group discussing fetal tissue. The videos have ignited a political firestorm, with conservative politicians calling for Planned Parenthood to be defunded and liberal activists questioning the authenticity of the videos.

Reacting to the videos, Governor Herbert directed state agencies to no longer act as a "pass through" for federal funding to go to Planned Parenthood of Utah, effectively cutting them off. The group claims the money is not used for abortions or abortion services, but for STD education, reproductive health, family planning and other services.

The reproductive services organization sued Governor Herbert on Monday, arguing that his directive to halt federal "pass through" funding to Planned Parenthood violated their rights. They accused the governor of singling them out on a "personal and political" agenda.

"It certainly has not violated any requirements for receiving federal pass through funding. Governor Herbert has done this and his directive has been implemented to carry out his own personal and political agenda to punish Planned Parenthood for exercising its constitutional rights," Tomsic told the judge.

Planned Parenthood of Utah requested the temporary injunction because funding would have been halted beginning Wednesday.

The Utah Attorney General's Office argued that the governor was within his authority and was concerned that Planned Parenthood was "coloring outside the lines." The governor, the state argued, has a legitimate concern when a group is associated with someone accused of breaking the law.

"The concern was the national Planned Parenthood organization was doing something illegal. It was selling fetal tissue," assistant Utah Attorney General Tyler Green argued.

"He is penalizing them for their association with a national organization. Why is that not a constitutional violation?" Judge Waddoups replied.

Waddoups pressed state lawyers on why Governor Herbert didn't wait until the investigation was completed about whether Planned Parenthood had broken any laws.

"There’s a reasonable inference this action was taken for political reasons and not a legitimate state reason," the judge said.

In a statement, Governor Herbert did not back down.

"The governor stands by his actions and looks forward to responding to Planned Parenthood’s claims in court," his office said in an email to FOX 13. "Today’s procedural action does not deter Governor Herbert’s resolve to carry out his directive."

The judge's ruling does not stop the lawsuit from moving forward. Another hearing is scheduled in 14 days on whether to extend the restraining order.