rick_scott_7.jpgTALLAHASSEE, Fla. (AP) – A federal appeals court ruled Wednesday that Gov. Rick Scott's state employee drug testing program went too far, and so did the lower court that found it unconstitutional.

t created a rare situation when both sides of a court dispute praised the decision.

The 11th Circuit Court sent the case back to the U.S. District Court. It said Scott doesn't have the right to order random drug testing for most of the 85,000 employees that would be covered under his 2011 executive order, but many of them could be tested without violating their constitutional rights.

U.S. District Judge Ursula Ungaro last year ruled that Scott's order was unconstitutional as an unreasonable search under the 4th Amendment.

But the appeals court cited a U.S. Supreme Court ruling that says drug testing without suspicion can be used in certain situations.

"The Fourth Amendment permits suspicionless drug testing of certain safety-sensitive categories of employees, for instance, employees who operate or pilot large vehicles, or law enforcement officers who carry firearms in the course of duty,'' the appeals court wrote in its opinion.

The court said Scott's attorneys were less than convincing when it said there could be safety issues with employees driving through parking lots, stacking boxes or climbing ladders.

"We have little doubt that a clerk, for example, cannot be subjected to suspicionless drug testing under the theory that she presents some vague and indefinite safety risk,'' the court wrote. "We reject the idea that a stack of heavy boxes or a wet floor falls within the same ballpark of risk as the operation of a ten-thousand-ton freight train or the danger posed by a person carrying a firearm.''

The court also said it didn't want to sort out who can be covered by the policy and who can't, and that's an issue that should be reviewed by the lower court. It also said it was the Scott administration's responsibility to identify the jobs that can be tested under the Constitution.

Scott said he applauded the court's decision to overturn the lower court's ruling that invalidated the program.

"Many Floridians are required to take drug tests in their workplace and it is only right for state workers paid with taxpayer funds to be required to do the same,'' Scott said in a statement issued by his office. "We will go forward in arguing this case in both the appellate and trial courts in order to ensure that taxpayer funds are safeguarded from misuse by ensuring our state workforce is drug free.''

The decision also was praised by the state workers union.

"Governor Scott's relentless quest for urine testing has once again been rejected by a federal court,'' Alma Gonzalez, a lawyer for the American Federation of State, County and Municipal Employees said in a statement. "People don't have to give up their privacy, dignity and constitutional protections in order to serve our communities.

Public employees should not be subject to arbitrary testing without probable cause or consent.''

Scott's office said it was preparing a statement Wednesday afternoon.

The executive order was one of Scott's first actions after taking office in Jan. 2011 and would have covered all employees and job applicants in executive branch agencies, or about three-quarters of all state employees.

The program was suspended except for Department of Corrections employees once it was legally challenged.