Updated

A controversial Seattle ordinance that allowed city workers to inspect people's trash -- as part of an effort to stop residents from throwing food scraps in the wrong pile -- was ruled unconstitutional on Wednesday.

King County Superior Court Judge Beth Andrus said sanitation works and other city collectors poking through everyday garbage violates privacy rights and voided the ordinance.

“I’m thrilled as can be,” Ethan Blevins, attorney for the Pacific Legal Foundation, which filed the lawsuit on behalf of eight Seattle residents, told The Seattle Times. He added, “We have been vindicated.”

The rule first went into effect last year, and was meant to compel residents to put food scraps in the same bins as yard waste, so all could be composted. Under the program, nine full-time solid waste inspectors as well as contracted waste haulers tagged trash cans with more than 10 percent compostable material, providing those residents with educational material on how to improve. Residents also were told that breaking the rules would come with a $1 fine for single-family homes and $50 fine for businesses or multi-family units.

Seattle Public Utilities spokesman Andy Ryan said the agency had not read the judge’s decision and did not provide an immediate response, according to The Seattle Times.

Lawyers for a group of homeowners who sued the city said it made garbage collectors snoop through trash like police detectives.

“I understand people have noble goals,” Keli Carender, who got tagged two weeks in a row, told Fox News last year. “But at some point we have to say, you can’t violate my rights to achieve this noble goal.”

Carender was among 14,000 residential and commercial customers who got “tagged” in 2015.