On the scale of embarrassing legal defeats, call this one a nine.

A state appeals court slammed Santa Rosa — justifiably so — concerning a dispute over use of a bike path through a gated community near Oakmont.

It's a complicated issue, and the city has a good argument for why bicyclists, contrary to the property owners' claims, should be able to use the right of way between this neighborhood and Annadel State Park. But the city deserved to be taken to the woodshed for its frivolous attempt at using California's anti-SLAPP statute to bring down its opponent.

Here's the issue in a nutshell. Santa Rosa filed suit against the Villages at Wild Oak Association in 2010 after the association posted "No trespassing" and "No bicycles" signs along a path through the residential area, a path that for years had been used by cyclists and joggers alike.

The association responded by counter-suing, alleging that the city had created a nuisance by encouraging public cycling through the area.

At that point, Santa Rosa should have settled for having the merits of the case settled in court. Instead, the city chose to file an anti-SLAPP motion against the homeowners.

California's anti-SLAPP statue was created in 1992 in response to a growing trend of corporations, developers and government agencies countersuing community groups or individuals in an effort to halt legal challenges to developments and other projects. In many cases, the SLAPP (Strategic Lawsuits Against Public Participation) suits were meritless and were intended primarily to delay, bury opponents in legal costs and chill public debate on important community issues.

Unfortunately, in some cases, government agencies themselves have since attempted to use the anti-SLAPP statute to halt legal action. Thankfully, their success has been limited.

Which is why the city of Santa Rosa should have left well enough alone when Sonoma County Superior Court Judge Elliot Daum ruled against the city, noting that it had failed to demonstrate that the association's claim was without merit.

But the city inexplicably chose to appeal, prompting the recent strong rebuke and a $40,000 fine by the 1st District Court of Appeal. The court said Santa Rosa "simply ignored" the lower court's primary reasoning for the ruling "and relied on the fiction" that it was founded on something else.

"Based on the record as a whole, including the city's repeated pattern of ignoring or misrepresenting relevant authority, we are persuaded that any reasonable attorney would agree the grounds the city relied on to advance its appeal completely lacked merit and would not have pursued the appeal," the three-judge panel ruled.

At the same time, it's hard to find anyone behaving like an adult in this matter. Some of the association's claims are equally spurious.

As the city has pointed out in court documents, when the Santa Rosa City Council changed the zoning of the property in 1977 to allow the subdivision to be built, it made clear that "public access to Annadel State Park shall be provided by easements through the Wild Oak property for pedestrian, equestrian and bicycle access."

The Villages' case rests on an easement deed recorded three years later that only referred to "pedestrian and emergency vehicle access" being granted on the path. The city claims the lack of specificity was an oversight, a contention that is supported by the record and a lack of any intention to eliminate bicyclists — or runners or horse riders for that matter — from the list of users.