A New Jersey state appeals court cleared a law firm of malicious civil prosecution on Wednesday in a decision that champions the right of lawyers to advocate zealously even when they know a claim is baseless.

Giordano, Halleran & Ciesla represented a beach club owner in a failed defamation suit against a neighbor. The neighbor, having won, countersued the club owner and the Middletown, N.J., firm, alleging the first suit had no purpose but to stifle her free speech rights maliciously.