FILE — Utah Governor Gary R. Herbert talks with media after taking a ride Wednesday, Oct. 7, 2015, in an F-35 cockpit demonstrator, at the University of Utah. The state health department warned Herbert that cutting funds for Planned Parenthood of Utah would be a bad idea and put some residents' health at risk, according to a new court filing

SALT LAKE CITY — The state health department warned Gov. Gary Herbert that cutting funds for Planned Parenthood of Utah would be a bad idea and put some residents' health at risk.

A week before Herbert's Aug. 14 directive, Utah Department of Health Deputy Director Robert Rolfs asked his staff to provide the governor "reasons why the state shouldn’t do that," according to a new court filing.

Among those reasons were that 4,400 patients would not receive STD testing, leading to long-term issues such as pelvic inflammatory disease and infertility, and that 3,725 people with chlamydia or gonorrhea and their partners would not receive treatment.

Four days after Herbert's order, Rolfs emailed the governor's staff saying "there are areas of service where we can’t avoid taking services away from women who would have been helped," court documents say.

Planned Parenthood included emails between Rolfs, his staff and the governor's office in a court brief filed late Tuesday supporting its request for a preliminary injunction in its lawsuit against the state.

Lawyers for the agency and the state will argue in federal court Thursday whether U.S. District Judge Clark Waddoups should halt the governor's directive pending the outcome of the case. The judge issued a temporary restraining order two weeks ago. Shortly afterward, the state said it would extend the funding through the end of the year.

The governor's office didn't have a response Wednesday to the emails cited in Planned Parenthood's court brief.

In August, Herbert ordered the health department to withhold about $272,000 in federal pass-through funds to Planned Parenthood for two after-school abstinence and reproductive health education programs, STD testing and an epidemiology database.

The directive came in reaction to controversial videos allegedly showing national Planned Parenthood officials discussing the selling of tissue from aborted fetuses for scientific research. Herbert described the alleged actions as "coloring outside the lines."

Planned Parenthood of Utah sued the state, claiming Herbert was punishing the organization based on his personal and political views, and violating its equal protection and free association rights.

State attorneys argued in a brief last week that Waddoups should not issue the injunction because Planned Parenthood isn't likely to win the case on its merits.

Waddoups would be the first judge in the country to find that a government contractor can make a "class-of-one" equal protection claim should he side with Planned Parenthood, assistant attorney general Tyler Green wrote.

The judge would also be the first to hold that the rights to association or abortion encompass a right to engage in or advocate for activities prohibited by federal law, in this case the alleged selling of fetal tissue, he wrote.

Also, the state argued that the court would have to reject Planned Parenthood’s own allegations about why Herbert cut the funding — that he was "outraged" by its affiliates "coloring outside the lines" — and find instead that his decision turned on other activities during his six years in office, and to which he had never before responded by cutting funding.

Green contends that any health risks are too speculative to justify a preliminary injunction. The alleged harms "will not in fact arise if the contracts are terminated, since the governor’s directive affects funding only for services that other vendors also provide," he wrote.

In its brief, Planned Parenthood cites health department emails that say ending the abstinence program would require the state to return the grant money to the federal government because it is the only provider of that curriculum. The organization also says access it has to difficult-to-reach, high-risk populations likely wouldn't continue with other providers.