A Miami federal judge Thursday slammed Gov. Rick Scott’s order requiring random drug testing for tens of thousands of state government employees as “unconstitutional” because his policy failed to specify any “public interests” to justify the invasion of privacy.

Scott immediately vowed to appeal the ruling, saying he believes that “drug testing state employees is a common sense means of ensuring a safe, efficient and productive workforce.”

But the governor would face a formidable challenge on appeal in the higher courts.

U.S. District Judge Ursula Ungaro declared that Scott’s executive order to conduct random drug tests of 85,000 state employees amounted to an “unreasonable” search under the Fourth Amendment of the Constitution. Her decision was based on U.S. Supreme Court precedents that have cited the Fourth Amendment ban on unreasonable searches, concluding that governments cannot require job applicants to take drug tests absent a “special need,” such as safety.